<!DOCTYPE html>
<html style="display: none;" lang="zh">
    <head>
    <meta charset="utf-8">
    <!--
        © Material Theme
        https://github.com/viosey/hexo-theme-material
        Version: 1.4.0 -->
    <script>window.materialVersion = "1.4.0"</script>

    <!-- Title -->
    
    <title>
        
            linux note | 
        
        David&#39;s blog
    </title>

    <!-- dns prefetch -->
    <meta http-equiv="x-dns-prefetch-control" content="on">
    
    
    
    
    
    
    
    
    
    

    <!-- Meta & Info -->
    <meta http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="theme-color" content="#0097A7">
    <meta name="author" content="David">
    <meta name="description" itemprop="description" content="">
    <meta name="keywords" content="">

    <!-- Site Verification -->
    
    

    <!-- Favicons -->
    <link rel="icon shortcut" type="image/ico" href="/img/favicon.png">
    <link rel="icon" sizes="192x192" href="/img/favicon.png">
    <link rel="apple-touch-icon" href="/img/favicon.png">

    <!--iOS -->
    <meta name="apple-mobile-web-app-title" content="Title">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="480">

    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">

    <!-- Add to homescreen for Safari on iOS -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="David&#39;s blog">

    <!-- The Open Graph protocol -->
    <meta property="og:url" content="http://yoursite.com/blog">
    <meta property="og:type" content="blog">
    <meta property="og:title" content="linux note | David&#39;s blog">
    <meta property="og:image" content="/img/favicon.png" />
    <meta property="og:description" content="">
    

    
        <meta property="article:published_time" content="8月 21, 2017" />
        <meta property="article:modified_time" content="8月 22, 2017" />
    

    <!-- The Twitter Card protocol -->
    <meta name="twitter:title" content="linux note | David&#39;s blog">
    <meta name="twitter:description" content="">
    <meta name="twitter:image" content="/img/favicon.png">
    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:url" content="http://yoursite.com/blog" />

    <!-- Add canonical link for SEO -->
    
        <link rel="canonical" href="http://yoursite.com/blog/blog/2017/08/21/linux-note/index.html" />
    

    <!-- Structured-data for SEO -->
    
        


<script type="application/ld+json">
{
    "@context": "https://schema.org",
    "@type": "Article",
    "publisher": {
        "@type": "Organization",
        "name": "David&#39;s blog",
        "logo": "/img/favicon.png"
    },
    "author": {
        "@type": "Person",
        "name": "David",
        "image": {
            "@type": "ImageObject",
            "url": "/img/favicon.png"
        },
        "description": "Hi, nice to meet you"
    },
    "headline": "linux note",
    "url": "http://yoursite.com/blog/blog/2017/08/21/linux-note/index.html",
    "datePublished": "8月 21, 2017",
    "dateModified": "8月 22, 2017",
    "description": "",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "http://yoursite.com/blog"
    }
}
</script>


    

    <!--[if lte IE 9]>
        <link rel="stylesheet" href="/css/ie-blocker.css">

        
            <script src="/js/ie-blocker.zhCN.js"></script>
        
    <![endif]-->

    <!-- Import lsloader -->
    <script>(function(){window.lsloader={jsRunSequence:[],jsnamemap:{},cssnamemap:{}};lsloader.removeLS=function(key){try{localStorage.removeItem(key)}catch(e){}};lsloader.setLS=function(key,val){try{localStorage.setItem(key,val)}catch(e){}};lsloader.getLS=function(key){var val="";try{val=localStorage.getItem(key)}catch(e){val=""}return val};versionString="/*"+materialVersion+"*/";lsloader.clean=function(){try{var keys=[];for(var i=0;i<localStorage.length;i++){keys.push(localStorage.key(i))}keys.forEach(function(key){var data=lsloader.getLS(key);if(data&&data.indexOf(versionString)===-1){lsloader.removeLS(key)}})}catch(e){}};lsloader.clean();lsloader.load=function(jsname,jspath,cssonload){cssonload=cssonload||function(){};var code;code=this.getLS(jsname);if(code&&code.indexOf(versionString)===-1){this.removeLS(jsname);this.requestResource(jsname,jspath,cssonload);return}if(code){var versionNumber=code.split(versionString)[0];if(versionNumber!=jspath){console.log("reload:"+jspath);this.removeLS(jsname);this.requestResource(jsname,jspath,cssonload);return}code=code.split(versionString)[1];if(/\.js?.+$/.test(versionNumber)){this.jsRunSequence.push({name:jsname,code:code});this.runjs(jspath,jsname,code)}else{document.getElementById(jsname).appendChild(document.createTextNode(code));cssonload()}}else{this.requestResource(jsname,jspath,cssonload)}};lsloader.requestResource=function(name,path,cssonload){var that=this;if(/\.js?.+$/.test(path)){this.iojs(path,name,function(path,name,code){that.setLS(name,path+versionString+code);that.runjs(path,name,code)})}else if(/\.css?.+$/.test(path)){this.iocss(path,name,function(code){document.getElementById(name).appendChild(document.createTextNode(code));that.setLS(name,path+versionString+code)},cssonload)}};lsloader.iojs=function(path,jsname,callback){var that=this;that.jsRunSequence.push({name:jsname,code:""});try{var xhr=new XMLHttpRequest;xhr.open("get",path,true);xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status>=200&&xhr.status<300||xhr.status==304){if(xhr.response!=""){callback(path,jsname,xhr.response);return}}that.jsfallback(path,jsname)}};xhr.send(null)}catch(e){that.jsfallback(path,jsname)}};lsloader.iocss=function(path,jsname,callback,cssonload){var that=this;try{var xhr=new XMLHttpRequest;xhr.open("get",path,true);xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status>=200&&xhr.status<300||xhr.status==304){if(xhr.response!=""){callback(xhr.response);cssonload();return}}that.cssfallback(path,jsname,cssonload)}};xhr.send(null)}catch(e){that.cssfallback(path,jsname,cssonload)}};lsloader.iofonts=function(path,jsname,callback,cssonload){var that=this;try{var xhr=new XMLHttpRequest;xhr.open("get",path,true);xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status>=200&&xhr.status<300||xhr.status==304){if(xhr.response!=""){callback(xhr.response);cssonload();return}}that.cssfallback(path,jsname,cssonload)}};xhr.send(null)}catch(e){that.cssfallback(path,jsname,cssonload)}};lsloader.runjs=function(path,name,code){if(!!name&&!!code){for(var k in this.jsRunSequence){if(this.jsRunSequence[k].name==name){this.jsRunSequence[k].code=code}}}if(!!this.jsRunSequence[0]&&!!this.jsRunSequence[0].code&&this.jsRunSequence[0].status!="failed"){var script=document.createElement("script");script.appendChild(document.createTextNode(this.jsRunSequence[0].code));script.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(script);this.jsRunSequence.shift();if(this.jsRunSequence.length>0){this.runjs()}}else if(!!this.jsRunSequence[0]&&this.jsRunSequence[0].status=="failed"){var that=this;var script=document.createElement("script");script.src=this.jsRunSequence[0].path;script.type="text/javascript";this.jsRunSequence[0].status="loading";script.onload=function(){that.jsRunSequence.shift();if(that.jsRunSequence.length>0){that.runjs()}};document.body.appendChild(script)}};lsloader.tagLoad=function(path,name){this.jsRunSequence.push({name:name,code:"",path:path,status:"failed"});this.runjs()};lsloader.jsfallback=function(path,name){if(!!this.jsnamemap[name]){return}else{this.jsnamemap[name]=name}for(var k in this.jsRunSequence){if(this.jsRunSequence[k].name==name){this.jsRunSequence[k].code="";this.jsRunSequence[k].status="failed";this.jsRunSequence[k].path=path}}this.runjs()};lsloader.cssfallback=function(path,name,cssonload){if(!!this.cssnamemap[name]){return}else{this.cssnamemap[name]=1}var link=document.createElement("link");link.type="text/css";link.href=path;link.rel="stylesheet";link.onload=link.onerror=cssonload;var root=document.getElementsByTagName("script")[0];root.parentNode.insertBefore(link,root)};lsloader.runInlineScript=function(scriptId,codeId){var code=document.getElementById(codeId).innerText;this.jsRunSequence.push({name:scriptId,code:code});this.runjs()};lsloader.loadCombo=function(jslist){var updateList="";var requestingModules={};for(var k in jslist){var LS=this.getLS(jslist[k].name);if(!!LS){var version=LS.split(versionString)[0];var code=LS.split(versionString)[1]}else{var version=""}if(version==jslist[k].path){this.jsRunSequence.push({name:jslist[k].name,code:code,path:jslist[k].path})}else{this.jsRunSequence.push({name:jslist[k].name,code:null,path:jslist[k].path,status:"comboloading"});requestingModules[jslist[k].name]=true;updateList+=(updateList==""?"":";")+jslist[k].path}}var that=this;if(!!updateList){var xhr=new XMLHttpRequest;xhr.open("get",combo+updateList,true);xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status>=200&&xhr.status<300||xhr.status==304){if(xhr.response!=""){that.runCombo(xhr.response,requestingModules);return}}else{for(var i in that.jsRunSequence){if(requestingModules[that.jsRunSequence[i].name]){that.jsRunSequence[i].status="failed"}}that.runjs()}}};xhr.send(null)}this.runjs()};lsloader.runCombo=function(comboCode,requestingModules){comboCode=comboCode.split("/*combojs*/");comboCode.shift();for(var k in this.jsRunSequence){if(!!requestingModules[this.jsRunSequence[k].name]&&!!comboCode[0]){this.jsRunSequence[k].status="comboJS";this.jsRunSequence[k].code=comboCode[0];this.setLS(this.jsRunSequence[k].name,this.jsRunSequence[k].path+versionString+comboCode[0]);comboCode.shift()}}this.runjs()}})();</script>

    <!-- Import CSS & jQuery -->
    
        <style id="css/material.min.css"></style><script>if(typeof window.lsLoadCSSMaxNums === "undefined")window.lsLoadCSSMaxNums = 0;window.lsLoadCSSMaxNums++;lsloader.load("css/material.min.css","/blog/css/material.min.css?fJTiM/K1J3dWIruo3pxtAw==",function(){if(typeof window.lsLoadCSSNums === "undefined")window.lsLoadCSSNums = 0;window.lsLoadCSSNums++;if(window.lsLoadCSSNums == window.lsLoadCSSMaxNums)document.documentElement.style.display="";})</script>
        <style id="css/style.min.css"></style><script>if(typeof window.lsLoadCSSMaxNums === "undefined")window.lsLoadCSSMaxNums = 0;window.lsLoadCSSMaxNums++;lsloader.load("css/style.min.css","/blog/css/style.min.css?oCSEO3ST+aEypEwttTDI9g==",function(){if(typeof window.lsLoadCSSNums === "undefined")window.lsLoadCSSNums = 0;window.lsLoadCSSNums++;if(window.lsLoadCSSNums == window.lsLoadCSSMaxNums)document.documentElement.style.display="";})</script>
        
        
            <style>
    
    .footer-sns-facebook {
        background-image: url();
    }
    
    
    .footer-sns-twitter {
        background-image: url();
    }
    
    
    .footer-sns-gplus {
        background-image: url();
    }
    
    
    
    
    
    
    
    
    
</style>

        
        <!-- Config CSS -->

<!-- Other Styles -->
<style>
  body, html {
    font-family: Roboto, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  }

  a {
    color: #00838F;
  }

  .mdl-card__media,
  #search-label,
  #search-form-label:after,
  #scheme-Paradox .hot_tags-count,
  #scheme-Paradox .sidebar_archives-count,
  #scheme-Paradox .sidebar-colored .sidebar-header,
  #scheme-Paradox .sidebar-colored .sidebar-badge{
    background-color: #0097A7 !important;
  }

  /* Sidebar User Drop Down Menu Text Color */
  #scheme-Paradox .sidebar-colored .sidebar-nav>.dropdown>.dropdown-menu>li>a:hover,
  #scheme-Paradox .sidebar-colored .sidebar-nav>.dropdown>.dropdown-menu>li>a:focus {
    color: #0097A7 !important;
  }

  #post_entry-right-info,
  .sidebar-colored .sidebar-nav li:hover > a,
  .sidebar-colored .sidebar-nav li:hover > a i,
  .sidebar-colored .sidebar-nav li > a:hover,
  .sidebar-colored .sidebar-nav li > a:hover i,
  .sidebar-colored .sidebar-nav li > a:focus i,
  .sidebar-colored .sidebar-nav > .open > a,
  .sidebar-colored .sidebar-nav > .open > a:hover,
  .sidebar-colored .sidebar-nav > .open > a:focus,
  #ds-reset #ds-ctx .ds-ctx-entry .ds-ctx-head a {
    color: #0097A7 !important;
  }

  .toTop {
    background: #757575 !important;
  }

  .material-layout .material-post>.material-nav,
  .material-layout .material-index>.material-nav,
  .material-nav a {
    color: #757575;
  }

  #scheme-Paradox .MD-burger-layer {
    background-color: #757575;
  }

  #scheme-Paradox #post-toc-trigger-btn {
    color: #757575;
  }

  .post-toc a:hover {
    color: #00838F;
    text-decoration: underline;
  }

</style>


<!-- Theme Background Related-->

    <style>
      body{
        background-color: #F5F5F5;
      }

      /* blog_info bottom background */
      #scheme-Paradox .material-layout .something-else .mdl-card__supporting-text{
        background-color: #fff;
      }
    </style>




<!-- Fade Effect -->

    <style>
      .fade {
        transition: all 800ms linear;
        -webkit-transform: translate3d(0,0,0);
        -moz-transform: translate3d(0,0,0);
        -ms-transform: translate3d(0,0,0);
        -o-transform: translate3d(0,0,0);
        transform: translate3d(0,0,0);
        opacity: 1;
      }

      .fade.out{
        opacity: 0;
      }
    </style>


<!-- Import Font -->

    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons"rel="stylesheet">


        <script>lsloader.load("js/jquery.min.js","/blog/js/jquery.min.js?qcusAULNeBksqffqUM2+Ig==")</script>
    
    
    <script>function Queue(){this.dataStore=[];this.offer=b;this.poll=d;this.execNext=a;this.debug=false;this.startDebug=c;function b(e){if(this.debug){console.log("Offered a Queued Function.")}if(typeof e==="function"){this.dataStore.push(e)}else{console.log("You must offer a function.")}}function d(){if(this.debug){console.log("Polled a Queued Function.")}return this.dataStore.shift()}function a(){var e=this.poll();if(e!==undefined){if(this.debug){console.log("Run a Queued Function.")}e()}}function c(){this.debug=true}}var queue=new Queue();</script>

    <!-- Analytics -->
    

    <!-- Custom Head -->
    
</head>


    
        <body id="scheme-Paradox" class="lazy">
            <div class="material-layout  mdl-js-layout has-drawer is-upgraded">
                

                <!-- Main Container -->
                <main class="material-layout__content" id="main">

                    <!-- Top Anchor -->
                    <div id="top"></div>

                    
                        <!-- Hamburger Button -->
                        <button class="MD-burger-icon sidebar-toggle">
                            <span class="MD-burger-layer"></span>
                        </button>
                    

                    <!-- Post TOC -->

    
    <!-- Back Button -->
    <!--
    <div class="material-back" id="backhome-div" tabindex="0">
        <a class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon"
           href="#" onclick="window.history.back();return false;"
           target="_self"
           role="button"
           data-upgraded=",MaterialButton,MaterialRipple">
            <i class="material-icons" role="presentation">arrow_back</i>
            <span class="mdl-button__ripple-container">
                <span class="mdl-ripple"></span>
            </span>
        </a>
    </div>
    -->

    <!-- Left aligned menu below button -->
    <button id="post-toc-trigger-btn"
        class="mdl-button mdl-js-button mdl-button--icon">
        <i class="material-icons">format_list_numbered</i>
    </button>

    
    <ul class="post-toc-wrap mdl-menu mdl-menu--bottom-left mdl-js-menu mdl-js-ripple-effect" for="post-toc-trigger-btn" style="max-height:80vh; overflow-y:scroll;">
        <ol class="post-toc"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#服务器安装git"><span class="post-toc-number">1.</span> <span class="post-toc-text">服务器安装git</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#建远程祼版本库"><span class="post-toc-number">2.</span> <span class="post-toc-text">建远程祼版本库</span></a></li></ol></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#export-GOARCH-386"><span class="post-toc-number"></span> <span class="post-toc-text">export GOARCH=386</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#export-GOOS-linux"><span class="post-toc-number"></span> <span class="post-toc-text">export GOOS=linux</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#wps-for-linux-安装出错"><span class="post-toc-number">1.</span> <span class="post-toc-text">wps for linux 安装出错</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#flyspell-出错的解决方案"><span class="post-toc-number">2.</span> <span class="post-toc-text">flyspell 出错的解决方案</span></a></li></ol></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#export-GOARCH-386-1"><span class="post-toc-number"></span> <span class="post-toc-text">export GOARCH=386</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#export-GOOS-linux-1"><span class="post-toc-number"></span> <span class="post-toc-text">export GOOS=linux</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#wps-for-linux-安装出错-1"><span class="post-toc-number">1.</span> <span class="post-toc-text">wps for linux 安装出错</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#flyspell-出错的解决方案-1"><span class="post-toc-number">2.</span> <span class="post-toc-text">flyspell 出错的解决方案</span></a></li></ol></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#export-GOARCH-386-2"><span class="post-toc-number"></span> <span class="post-toc-text">export GOARCH=386</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#export-GOOS-linux-2"><span class="post-toc-number"></span> <span class="post-toc-text">export GOOS=linux</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#wps-for-linux-安装出错-2"><span class="post-toc-number">1.</span> <span class="post-toc-text">wps for linux 安装出错</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#flyspell-出错的解决方案-2"><span class="post-toc-number">2.</span> <span class="post-toc-text">flyspell 出错的解决方案</span></a></li></ol></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#go-xc766-com-一元云购"><span class="post-toc-number"></span> <span class="post-toc-text">go.xc766.com 一元云购</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#git-更新到最新版本的方法"><span class="post-toc-number"></span> <span class="post-toc-text">git 更新到最新版本的方法</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#nginx安装"><span class="post-toc-number"></span> <span class="post-toc-text">nginx安装</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#数据库导出"><span class="post-toc-number"></span> <span class="post-toc-text">数据库导出</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#补充php类库"><span class="post-toc-number"></span> <span class="post-toc-text">补充php类库</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#linux-tar实现分卷压缩与还原数据方法"><span class="post-toc-number"></span> <span class="post-toc-text">linux tar实现分卷压缩与还原数据方法</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#markdown-语法"><span class="post-toc-number"></span> <span class="post-toc-text">markdown 语法</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#github工作流"><span class="post-toc-number"></span> <span class="post-toc-text">github工作流</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#lsof-i-192-168-1-91"><span class="post-toc-number"></span> <span class="post-toc-text">lsof -i@192.168.1.91</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#lsof-i-192-168-1-91-1"><span class="post-toc-number"></span> <span class="post-toc-text">lsof -i@192.168.1.91</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#yum-update-bash"><span class="post-toc-number"></span> <span class="post-toc-text">yum update bash</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#yum-update-bash-4-1-2-15-el6-5-1"><span class="post-toc-number"></span> <span class="post-toc-text">yum update bash-4.1.2-15.el6_5.1</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#yum-update-bash-1"><span class="post-toc-number"></span> <span class="post-toc-text">yum update bash</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#yum-update-bash-4-1-2-15-el6-5-1-1"><span class="post-toc-number"></span> <span class="post-toc-text">yum update bash-4.1.2-15.el6_5.1</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#tar-cf-all-tar-jpg"><span class="post-toc-number"></span> <span class="post-toc-text">tar -cf all.tar *.jpg</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#tar-rf-all-tar-gif"><span class="post-toc-number"></span> <span class="post-toc-text">tar -rf all.tar *.gif</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#tar-uf-all-tar-logo-gif"><span class="post-toc-number"></span> <span class="post-toc-text">tar -uf all.tar logo.gif</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#tar-tf-all-tar"><span class="post-toc-number"></span> <span class="post-toc-text">tar -tf all.tar</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#tar-xf-all-tar"><span class="post-toc-number"></span> <span class="post-toc-text">tar -xf all.tar</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#tar-xvf-node-v0-10-28-tar-gz"><span class="post-toc-number"></span> <span class="post-toc-text">tar xvf node-v0.10.28.tar.gz</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#cd-node-v0-10-28"><span class="post-toc-number"></span> <span class="post-toc-text">cd node-v0.10.28</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#configure"><span class="post-toc-number"></span> <span class="post-toc-text">./configure</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#make"><span class="post-toc-number"></span> <span class="post-toc-text">make</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#make-install"><span class="post-toc-number"></span> <span class="post-toc-text">make install</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#cp-usr-local-bin-node-usr-sbin"><span class="post-toc-number"></span> <span class="post-toc-text">cp /usr/local/bin/node /usr/sbin/</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#node-v"><span class="post-toc-number"></span> <span class="post-toc-text">node -v</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#emacs-安装配置"><span class="post-toc-number">1.</span> <span class="post-toc-text">emacs 安装配置</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#melpa配置"><span class="post-toc-number">2.</span> <span class="post-toc-text">melpa配置</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#字体设置"><span class="post-toc-number">3.</span> <span class="post-toc-text">字体设置</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#安装go-mode"><span class="post-toc-number">4.</span> <span class="post-toc-text">安装go-mode</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#gocode安装"><span class="post-toc-number">5.</span> <span class="post-toc-text">gocode安装</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#安装gocode-src-emacs下的-go-autocomplete"><span class="post-toc-number">6.</span> <span class="post-toc-text">安装gocode/src/emacs下的　go-autocomplete</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#启动器启动时gocode出错，暂时用命令emacs打开"><span class="post-toc-number">7.</span> <span class="post-toc-text">启动器启动时gocode出错，暂时用命令emacs打开</span></a></li></ol></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#yum-update-bash-2"><span class="post-toc-number"></span> <span class="post-toc-text">yum update bash</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#yum-update-bash-4-1-2-15-el6-5-1-2"><span class="post-toc-number"></span> <span class="post-toc-text">yum update bash-4.1.2-15.el6_5.1</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#win10-mbr-gt-gpt"><span class="post-toc-number">1.</span> <span class="post-toc-text">win10 mbr=>gpt</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#nfts分区mount出错的修复"><span class="post-toc-number">2.</span> <span class="post-toc-text">nfts分区mount出错的修复</span></a></li></ol>
        <!--
        <li class="mdl-menu__item">
            Some Action
        </li>
        -->
    </ul>
    





<!-- Layouts -->

    <!-- Post Module -->
    <div class="material-post_container">

        <div class="material-post mdl-grid">
            <div class="mdl-card mdl-shadow--4dp mdl-cell mdl-cell--12-col">

                <!-- Post Header(Thumbnail & Title) -->
                
    <!-- Paradox Post Header -->
    
        
            <!-- Random Thumbnail -->
            <div class="post_thumbnail-random mdl-card__media mdl-color-text--grey-50">
            <script type="text/ls-javascript" id="post-thumbnail-script">
    var randomNum = Math.floor(Math.random() * 19 + 1);

    $('.post_thumbnail-random').attr('data-original', '/blog/img/random/material-' + randomNum + '.png');
    $('.post_thumbnail-random').addClass('lazy');
</script>

        
    
            <p class="article-headline-p">
                linux note
            </p>
        </div>





                
                    <!-- Paradox Post Info -->
                    <div class="mdl-color-text--grey-700 mdl-card__supporting-text meta">

    <!-- Author Avatar -->
    <div id="author-avatar">
        <img src="/blog/img/avatar.png" width="44px" height="44px" alt="Author Avatar"/>
    </div>
    <!-- Author Name & Date -->
    <div>
        <strong>David</strong>
        <span>8月 21, 2017</span>
    </div>

    <div class="section-spacer"></div>

    <!-- Favorite -->
    <!--
        <button id="article-functions-like-button" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon btn-like">
            <i class="material-icons" role="presentation">favorite</i>
            <span class="visuallyhidden">favorites</span>
        </button>
    -->

    <!-- Qrcode -->
    

    <!-- Tags (bookmark) -->
    
    <button id="article-functions-viewtags-button" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon">
        <i class="material-icons" role="presentation">bookmark</i>
        <span class="visuallyhidden">bookmark</span>
    </button>
    <ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="article-functions-viewtags-button">
        <li class="mdl-menu__item">
        
    </ul>
    

    <!-- Share -->
    <button id="article-fuctions-share-button" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon">
    <i class="material-icons" role="presentation">share</i>
    <span class="visuallyhidden">share</span>
</button>
<ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="article-fuctions-share-button">
    

    

    <!-- Share Weibo -->
    
        <a class="post_share-link" href="http://service.weibo.com/share/share.php?appkey=&title=linux note&url=http://yoursite.com/blog/blog/2017/08/21/linux-note/index.html&pic=&searchPic=false&style=simple" target="_blank">
            <li class="mdl-menu__item">
                分享到微博
            </li>
        </a>
    

    <!-- Share Twitter -->
    
        <a class="post_share-link" href="https://twitter.com/intent/tweet?text=linux note&url=http://yoursite.com/blog/blog/2017/08/21/linux-note/index.html&via=David" target="_blank">
            <li class="mdl-menu__item">
                分享到 Twitter
            </li>
        </a>
    

    <!-- Share Facebook -->
    
        <a class="post_share-link" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/blog/blog/2017/08/21/linux-note/index.html" target="_blank">
            <li class="mdl-menu__item">
                分享到 Facebook
            </li>
        </a>
    

    <!-- Share Google+ -->
    
        <a class="post_share-link" href="https://plus.google.com/share?url=http://yoursite.com/blog/blog/2017/08/21/linux-note/index.html" target="_blank">
            <li class="mdl-menu__item">
                分享到 Google+
            </li>
        </a>
    

    <!-- Share LinkedIn -->
    

    <!-- Share QQ -->
    

    <!-- Share Telegram -->
    
</ul>

</div>

                

                <!-- Post Content -->
                <div id="post-content" class="mdl-color-text--grey-700 mdl-card__supporting-text fade out">
    
        <p>dpkg -i google-ch<br>apt install fcitx-table-wubi<br>etc/modprobe/alsa-base.conf<br>options snd-hda-intel model=generic<br>sudo add-apt-repository ppa:git-core/ppa<br> sudo apt-get update<br> sudo apt-get install git</p>
<p>1.uget的安装：<br>sudo add-apt-repository ppa:plushuang-tw/uget-stable<br>sudo apt-get update<br>sudo apt-get install uget<br>2.aria2的安装：<br>sudo add-apt-repository ppa:t-tujikawa/ppa<br>sudo apt-get update<br>sudo apt-get install aria2</p>
<p><a href="https://github.com/adobe-fonts/source-code-pro/downloads" target="_blank" rel="external">https://github.com/adobe-fonts/source-code-pro/downloads</a><br>SourceCodePro_FontsOnly-1.013.zip<br>复制SourceCodePro_FontsOnly-1.013/OTF目录中的所有.otf文件到~/.fonts目录下，<br>$fc-cache -f -v</p>
<p>sudo apt install emacs 24.5.1</p>
<p>go build -ldflags “-s -w” (go install类似)<br>-s去掉符号表（然后panic时候的stack trace就没有任何文件名/行号信息了，<br>这个等价于普通C/C++程序被strip的效果），<br>-w去掉DWARF调试信息，得到的程序就不能用gdb调试了。<br>scp<br>-C 使能压缩选项 .</p>
<p>promo-layer 版权说明</p>
<p>ssh-keygen -t rsa -C “gitusr@yunhor.com”</p>
<p>www.toplift.cn<br>gitusr,yh888</p>
<p>go build -ldflags “-w” -o bin/toplift src/main.go<br>go build -ldflags “-w” -o ./toplift ../src/main.go<br>./toplift -p 6010</p>
<p>A 设置Git的user name和email：<br>$ git config –global user.name “abc”<br>$ git config –global user.email “abc@163.com”</p>
<p>B 生成SSH密钥过程：<br>1.查看是否已经有了ssh密钥：cd ~/.ssh<br>如果没有密钥则不会有此文件夹，有则备份删除<br>2.生存密钥：<br>$ ssh-keygen -t rsa -C “abc@163.com”<br>按3个回车，密码为空。</p>
<p>Your identification has been saved in /home/abc/.ssh/id_rsa.<br>Your public key has been saved in /home/abc/.ssh/id_rsa.pub.<br>The key fingerprint is:<br>………………</p>
<p>最后得到了两个文件：id_rsa和id_rsa.pub</p>
<p>3.添加密钥到ssh：ssh-add 文件名<br>需要之前输入密码。<br>4.在github上添加ssh密钥，这要添加的是“id_rsa.pub”里面的公钥。<br>登陆 <a href="https://github.com/" target="_blank" rel="external">https://github.com/</a> ，然后添加ssh。</p>
<p>5.测试：ssh git@github.com<br>The authenticity of host ‘github.com (207.97.227.239)’ can’t be established.<br>RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.<br>Are you sure you want to continue connecting (yes/no)? yes<br>Warning: Permanently added ‘github.com,207.97.227.239′ (RSA) to the list of known hosts.<br>ERROR: Hi tekkub! You’ve successfully authenticated, but GitHub does not provide shell access<br>Connection to github.com closed.</p>
<p>C、 开始使用github<br>1.获取源码：<br>$ git clone git@github.com:billyanyteen/github-services.git<br>2.这样你的机器上就有一个repo了。<br>3.git于svn所不同的是git是分布式的，没有服务器概念。所有的人的机器上都有一个repo，每次提交都是给自己机器的repo<br>仓库初始化：<br>git init<br>生成快照并存入项目索引：<br>git add<br>文件,还有git rm,git mv等等…<br>项目索引提交：<br>git commit<br>4.协作编程：<br>将本地repo于远程的origin的repo合并，<br>推送本地更新到远程：<br>git push origin master<br>更新远程更新到本地：<br>git pull origin master<br>补充：<br>添加远端repo：<br>$ git remote add upstream git://github.com/pjhyett/github-services.git<br>重命名远端repo：<br>$ git://github.com/pjhyett/github-services.git为“upstream”</p>
<h3 id="服务器安装git"><a href="#服务器安装git" class="headerlink" title="服务器安装git"></a>服务器安装git</h3><p>apt-get install git<br>git config –global user.name gitusr@yunhor.com<br>git config –global user.email gitusr@yunhor.com<br>git config –global receive.denyCurrentBranch ignore<br>git config –global –bool receive.denyNonFastForwards false</p>
<p>sudo adduser gitusr  pwd:yh888<br>su gitusr </p>
<p>ssh-keygen -t rsa -C “gitusr@yunhor.com”<br>或者<br>cd ~<br>mkdir .ssh<br>cd .ssh<br>客户端<br>scp ~/.ssh/id_dsa.pub root@120.24.52.23:/home/gitusr/.ssh/pub<br>服务器<br>cat pub &gt;&gt; authorized_keys<br>exit<br>sudo vi /etc/passwd<br>将gitusr的sh配置成 /usr/bin/git-shell<br>类似这样<br>gitusr:x:1000:1000:,,,:/home/gitusr:/usr/bin/git-shell</p>
<h3 id="建远程祼版本库"><a href="#建远程祼版本库" class="headerlink" title="建远程祼版本库"></a>建远程祼版本库</h3><p>cd /home/www<br>mkdir www.toplift.cn<br>cd www.toplift.cn<br>mkdir web<br>git init –bare .git<br>cd .git/hooks<br>vi post-receive<br><code>#!/bin/sh</code><br><code>GIT_WORK_TREE=/home/www/www.toplift.cn/web git checkout -f</code></p>
<p>chmod +x post-receive<br>sudo chown -R gitusr:gitusr www</p>
<p>客户端<br>git remote add prod gitusr@121.40.80.157:/home/www/www.toplift.cn/.git<br>git remote add origin git@git.coding.net:yunhor/www.toplift.cn.git</p>
<p>cd bin<br>tar zcvf ~/toplift.tar.gz ./</p>
<p>1.安装nginx<br>    apt-get update<br>    apt-get install software-properties-common<br>    add-apt-repository ppa:nginx/development<br>    apt-get update<br>    apt-get install nginx<br>    1.9.11<br>2.安装supervisorctl<br>    apt-get install supervisor<br>6.域名解析<br>    m.i6yi.com,www.i6yi.com,car.i6yi.com<br>3.安装psql<br>   apt-get install postgresql 9.3.11<br>   passwd postgres 6yi201688<em><br>   su postgres<br>   psql postgres<br>   alter user postgres with password ‘6yi201688</em>‘;<br>   CREATE USER i6edb WITH PASSWORD ‘6yi201688*’;<br>   CREATE DATABASE i6edb;<br>   GRANT ALL PRIVILEGES ON DATABASE i6edb to i6edb;</p>
<p>   CREATE USER i6ecardb WITH PASSWORD ‘6yi201688*’;<br>   CREATE DATABASE i6ecardb;<br>   GRANT ALL PRIVILEGES ON DATABASE i6ecardb to i6ecardb;</p>
<p>   psql -U i6edb -d i6edb -h 127.0.0.1;<br>    sudo /etc/init.d/postgresql status<br>    sudo /etc/init.d/postgresql stop<br>   sudo /etc/init.d/postgresql restart</p>
<p>4.安装配置git<br>5.配置基本的公众号</p>
<p>sudo apt install fcitx-table-wbpy<br>Ctrl+Alt+T （默认终端快捷键）打开终端，输入一下命令：<br>首先更改系统语言环境为英文<br>export LANG=en_US<br>然后更改设置<br>xdg-user-dirs-gtk-update<br>接着更改回中文语言环境<br>export LANG=zh_CN.UTF-8<br>再次执行<br>xdg-user-dirs-gtk-update<br>此时再次弹出界面，选择“保留旧的名称”</p>
<p>ssh-keygen -t rsa -C “email”</p>
<p> chmod 0600 ~/.ssh/id_rsa<br>scp id_rsa.pub remotehost authorized_keys or cat id_rsa.pub&gt;&gt; authorized_keys<br>git init –bare web.git<br>hooks/post-receive </p>
<p>#!/bin/sh<br>GIT_WORK_TREE=/home/www/site/web git checkout -f<br>rm -Rf /home/www/site/web/src</p>
<p>chmod +x post-recevie<br>localhost<br>$ git remote add deploy root@121.40.87.70:/home/www/usiot/web.git<br>$ git push deploy master<br>git push -u origin master<br>sudo add-apt-repository ppa:git-core/ppa<br>sudo apt-get update<br>sudo apt-get install git<br>[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype<br>sudo git clone –depth 1 –branch release git@github.com:adobe-fonts/source-code-pro.git /usr/share/fonts/opentype/scp<br>sudo fc-cache -f -v</p>
<p>sudo add-apt-repository ppa:ubuntu-elisp/ppa<br>sudo apt update<br>sudo apt install emacs-snapshot emacs-snapshot-el</p>
<p>mv ~/.emacs.d ~/Documents/.emacs.d.bak<br>git clone git@github.com:syl20bnr/spacemacs.git ~/.emacs.d<br>git checkout –track origin/develop<br>git pull –rebase</p>
<p>$xz -d <strong><em>.tar.xz<br>$tar -xvf  </em></strong>.tar 或</p>
<p> tar xvJf  <em>*</em>.tar.xz</p>
<p>sudo mv node-v7.2.0-linux-x64 /opt/node<br>ln -s /opt/node/bin/node /usr/local/bin/node<br>ln -s /opt/node/bin/npm /usr/local/bin/npm<br>node –version</p>
<p>vi ~/.bashrc<br>export NODE_HOME=/opt/node<br>export PATH=$PATH:$NODE_HOME/bin<br>export NODE_PATH=$PATH:$NODE_HOME/lib/node_modules<br>source ~/.bashrc<br>设置PATH后，hexo等全局插件运行才不会找不到文件。</p>
<p>tar zvxf go-<br>mv go- ~/<br>export GOROOT=$HOME/go<br>export GOBIN=$GOROOT/bin</p>
<h1 id="export-GOARCH-386"><a href="#export-GOARCH-386" class="headerlink" title="export GOARCH=386"></a>export GOARCH=386</h1><h1 id="export-GOOS-linux"><a href="#export-GOOS-linux" class="headerlink" title="export GOOS=linux"></a>export GOOS=linux</h1><p>export GOPATH=$HOME/gorepos<br>export PATH=$PATH:$GOROOT/bin:$GOPATH/bin<br>go version</p>
<p>vi ~/.emacs.d/init.el<br>(require ‘package)<br>(setq package-archives ‘((“gnu”   . “<a href="http://elpa.zilongshanren.com/gnu/" target="_blank" rel="external">http://elpa.zilongshanren.com/gnu/</a>“)<br>                         (“org”   . “<a href="http://elpa.zilongshanren.com/org/" target="_blank" rel="external">http://elpa.zilongshanren.com/org/</a>“)<br>                         (“melpa” . “<a href="http://elpa.zilongshanren.com/melpa/" target="_blank" rel="external">http://elpa.zilongshanren.com/melpa/</a>“)))<br>(package-initialize)</p>
<p>go 插件</p>
<p>go get -u -v github.com/nsf/gocode<br>go get -u -v github.com/rogpeppe/godef<br>go get -u -v github.com/zmb3/gogetdoc<br>go get -u -v github.com/golang/lint/golint<br>go get -u -v github.com/lukehoban/go-outline<br>go get -u -v sourcegraph.com/sqs/goreturns<br>go get -u -v golang.org/x/tools/cmd/gorename<br>go get -u -v github.com/tpng/gopkgs<br>go get -u -v github.com/newhook/go-symbols<br>go get -u -v golang.org/x/tools/cmd/guru<br>go get -u -v github.com/cweill/gotests/…</p>
<p>输入下面命令安装pavucontrol：</p>
<p> #sudo apt install pavucontrol</p>
<p>#pavucontrol<br>打开选项卡后进行:<br>“回放”–&gt;系统下面的选项–&gt;内置音频模拟立体声<br>“输出设备”–&gt;port：headphone(unplugged) 模拟耳机</p>
<p>$ sudo apt-add-repository ppa:ubuntu-elisp/ppa<br>sudo apt upgrade<br>sudo apt update<br>$ sudo apt install emacs-snapshot emacs-snapshot-el</p>
<p>mv ~/.emacs.d ~/.emacs.bak<br>git clone git@github.com:syl20bnr/spacemacs.git ~/.emacs.d</p>
<p>git checkout –track checkversion/develop</p>
<p>emacs –insecure<br>安装Source Code Pro 字体<br>只clone release 分支，很重要，否则字体是乱码,体积也很大<br>[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype<br>git clone –depth 1 –branch release git@github.com:adobe-fonts/source-code-pro.git scp<br>sudo mv /usr/share/fonts/opentype/scp<br>sudo fc-cache -f -v</p>
<p>由于码农的洁癖，老版本必须删除。先查看安装包的名称：<br>dpkg -S emacs<br>再全部删除：<br>apt-get remove emacs24-bin-common emacs24-common emacs24-common-non-dfsg emacs24-nox<br>gsettings set com.canonical.Unity.Launcher launcher-position Bottom</p>
<p>安装WPS for Linux。下载地址：<a href="http://community.wps.cn/download/。选择alpha版deb包。" target="_blank" rel="external">http://community.wps.cn/download/。选择alpha版deb包。</a></p>
<p>   Linux 64 bit需要通过安装32 bit的库来获得支持。</p>
<p>   #sudo apt-get install ia32-libs</p>
<p>   但是输入命令后系统提示ia32-libs软件包缺失，需要用lib32ncurses5和lib32z1代替。于是运行</p>
<p>   #sudo apt-get install lib32ncurses5</p>
<p>   #sudo apt-get install lib32z1。</p>
<p>   再dpkg安装程序安装包</p>
<p>   #sudo dpkg -i wps-office_10.1.0.5672~a21_amd64.deb<br>   提示wps-office 依赖于 libpng12-0；然而：未安装软件包 libpng12-0。该软件包已丢失可用ttf-mscorefonts-installer代替。</p>
<p>   要先运行下面的命令将已安装的wps-office卸载：</p>
<p>   #apt-get -f install</p>
<p>   然后安装依赖关系：</p>
<p>   #sudp apt-get install ttf-mscorefonts-installer</p>
<p>   之后libpng12-0依赖关系还是出错，到下面的地址下载libpng12-0然后安装：</p>
<p>   <a href="https://packages.debian.org/zh-cn/wheezy/amd64/libpng12-0/download。" target="_blank" rel="external">https://packages.debian.org/zh-cn/wheezy/amd64/libpng12-0/download。</a></p>
<p>   #sudo dpkg -i libpng12-0_1.2.49-1+deb7u2_amd64.deb</p>
<p>   安装好后到Dash中搜索WPS启动并锁定到启动器，会报错显示缺失字体：</p>
<p>   Symbol，Wingdings，Wingdings2，Wingdings3，MT-Extra</p>
<p>   进入home文件夹，按Ctrl+h显示所有文件夹，查看有没有.fonts文件夹，如果没有就创建一个，然后到网上下载相关字体放入该文件夹中</p>
<p>7.安装vim编辑器。sudo apt-get install vim</p>
<p>8.安装unrar。sudo apt-get install rar unrar</p>
<p>9.删除Amazon的链接：sudo apt-get remove unity-webapps-common</p>
<p>10.安装Git：sudo apt-get install git</p>
<p>11.主题美化，安装Unity Tweak Tool：到Ubuntu软件中心搜索Unity Tweak Tool并安装</p>
<h3 id="wps-for-linux-安装出错"><a href="#wps-for-linux-安装出错" class="headerlink" title="wps for linux 安装出错"></a>wps for linux 安装出错</h3><h3 id="flyspell-出错的解决方案"><a href="#flyspell-出错的解决方案" class="headerlink" title="flyspell 出错的解决方案"></a>flyspell 出错的解决方案</h3><pre><code>sudo vi /etc/aspell.conf 
lang en
</code></pre><p>作者：黄欢<br>链接：<a href="https://www.zhihu.com/question/47538279/answer/126170419" target="_blank" rel="external">https://www.zhihu.com/question/47538279/answer/126170419</a><br>来源：知乎<br>著作权归作者所有，转载请联系作者获得授权。</p>
<p>全局一个 gopath 和 每个项目一个单独的 gopath, 各有优缺点.<br>针对2种选择, 各推荐一个较优实践(欢迎分享更好的做法).</p>
<p>golang 官方文档里的选择:<br><a href="https://golang.org/doc/code.html" target="_blank" rel="external">https://golang.org/doc/code.html</a><br>对应中文文档:<br>如何使用Go编程</p>
<p>stackoverflow 上两种选择, 也是一半一半.<br>Whats a good best practice with Go workspaces?</p>
<p>———————— 全局一个 gopath 做法 ————————————-</p>
<p>我个人开发环境是设置一个 gopath, 配合 glide 管理.<br>全局一个 gopath 较优方案:<br>github管理源码 + glide(go 包管理工具)管理依赖包</p>
<p>glide 介绍:<br>1.是一个 golang 的包管理工具.</p>
<ol>
<li>功能类似 Python 的 pip + virtualenv. (个人理解)</li>
<li>可以锁定项目版本, 会在当前工程目录创建 vendor 目录, 存放所有依赖包.(可认为是个虚拟隔离环境)</li>
<li>默认优先从 vendor 下搜索依赖, 找不到, 再从全局 gopath 找.</li>
<li>这样不会污染全局的包(避免各项目依赖包版本冲突问题).<br>glide 工具: GitHub - Masterminds/glide: Package Management for Golang</li>
</ol>
<p>用法:<br>Getting Started<br>Golang 套件管理工具 Glide<br>glide使用 - golang</p>
<p>如何实践, 可以参考 gogs 项目对 glide 的应用:<br>GitHub - gogits/gogs: Gogs (Go Git Service) is a painless self-hosted Git service.</p>
<p>———————— 每个项目设置一个 gopath 推荐做法 ————————</p>
<p>per 项目 per gopath 推荐做法:<br>使用如下 脚本, 初始化.(非原创)</p>
<p>优点: </p>
<ol>
<li>自动创建 项目目录结构.</li>
<li>每个项目都是设置临时的 gopath, 避免污染全局的 gopath, 属于随用随初始化, 用完就扔那种. </li>
</ol>
<p>用法:</p>
<p>保存如下脚本内容到: create_go_proj.sh<br>执行如下命令, 创建项目初始工程目录:<br>sh ./create_go_proj.sh myproject</p>
<p>　　ubuntu上安装mysql非常简单只需要几条命令就可以完成。</p>
<p>　　1. sudo apt install mysql-server</p>
<p>　　2. sudo apt install mysql-client</p>
<p>　　3.  sudo apt install libmysqlclient-dev</p>
<p>　　安装过程中会提示设置密码什么的，注意设置了不要忘了，安装完成之后可以使用如下命令来检查是否安装成功：</p>
<p>　　sudo netstat -tap | grep mysql</p>
<p>　　通过上述命令检查之后，如果看到有mysql 的socket处于 listen 状态则表示安装成功。</p>
<p>　　登陆mysql数据库可以通过如下命令：</p>
<p>　　mysql -u root -p </p>
<p>desc 表名;<br>show columns from 表名;<br>describe 表名;<br>show create table 表名;</p>
<p>use information_schema<br>select * from columns where table_name=’表名’;</p>
<p>show databases;<br>show tables;</p>
<p>mysqldump -h -u root -p db_name &gt; test_db.sql</p>
<p>sudo apt install vagrant<br>安装 vagrant virtual box</p>
<p><a href="https://www.virtualbox.org/wiki/Downloads" target="_blank" rel="external">https://www.virtualbox.org/wiki/Downloads</a></p>
<p>npm install -g cnpm –registry=<a href="https://registry.npm.taobao.org" target="_blank" rel="external">https://registry.npm.taobao.org</a><br>cnpm install -g webpack@2.2.0-rc.3</p>
<p>sudo apt install software-properties-common<br>sudo apt install python-software-properties</p>
<p>sudo apt-add-repository ppa:nginx/development<br>sudo apt-get update<br>sudo apt-get install nginx<br>sudo service nginx start</p>
<p>sudo apt install fcitx-table-wbpy<br>Ctrl+Alt+T （默认终端快捷键）打开终端，输入一下命令：<br>首先更改系统语言环境为英文<br>export LANG=en_US<br>然后更改设置<br>xdg-user-dirs-gtk-update<br>接着更改回中文语言环境<br>export LANG=zh_CN.UTF-8<br>再次执行<br>xdg-user-dirs-gtk-update<br>此时再次弹出界面，选择“保留旧的名称”<br>sudo apt install openssh-server</p>
<p>ssh-keygen -t rsa -C “email”</p>
<p>sudo add-apt-repository ppa:git-core/ppa<br>sudo apt-get update<br>sudo apt-get install git<br>[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype<br>sudo git clone –depth 1 –branch release git@github.com:adobe-fonts/source-code-pro.git /usr/share/fonts/opentype/scp<br>sudo fc-cache -f -v</p>
<p>sudo add-apt-repository ppa:ubuntu-elisp/ppa<br>sudo apt update<br>sudo apt install emacs-snapshot emacs-snapshot-el</p>
<p>mv ~/.emacs.d ~/Documents/.emacs.d.bak<br>git clone git@github.com:syl20bnr/spacemacs.git ~/.emacs.d<br>git checkout –track origin/develop<br>git pull –rebase</p>
<p>$xz -d <strong><em>.tar.xz<br>$tar -xvf  </em></strong>.tar 或</p>
<p> tar xvJf  <em>*</em>.tar.xz</p>
<p>sudo mv node-v7.2.0-linux-x64 /opt/node<br>ln -s /opt/node/bin/node /usr/local/bin/node<br>ln -s /opt/node/bin/npm /usr/local/bin/npm<br>node –version</p>
<p>vi ~/.bashrc<br>export NODE_HOME=/opt/node<br>export PATH=$PATH:$NODE_HOME/bin<br>export NODE_PATH=$PATH:$NODE_HOME/lib/node_modules<br>source ~/.bashrc<br>设置PATH后，hexo等全局插件运行才不会找不到文件。</p>
<p>tar zvxf go-<br>mv go- ~/<br>export GOROOT=$HOME/go<br>export GOBIN=$GOROOT/bin</p>
<h1 id="export-GOARCH-386-1"><a href="#export-GOARCH-386-1" class="headerlink" title="export GOARCH=386"></a>export GOARCH=386</h1><h1 id="export-GOOS-linux-1"><a href="#export-GOOS-linux-1" class="headerlink" title="export GOOS=linux"></a>export GOOS=linux</h1><p>export GOPATH=$HOME/gorepos<br>export PATH=$PATH:$GOROOT/bin:$GOPATH/bin<br>go version</p>
<p>vi ~/.emacs.d/init.el<br>(require ‘package)<br>(setq package-archives ‘((“gnu”   . “<a href="http://elpa.zilongshanren.com/gnu/" target="_blank" rel="external">http://elpa.zilongshanren.com/gnu/</a>“)<br>                         (“org”   . “<a href="http://elpa.zilongshanren.com/org/" target="_blank" rel="external">http://elpa.zilongshanren.com/org/</a>“)<br>                         (“melpa” . “<a href="http://elpa.zilongshanren.com/melpa/" target="_blank" rel="external">http://elpa.zilongshanren.com/melpa/</a>“)))<br>(package-initialize)</p>
<p>151.101.112.249<br>go get -u github.com/dougm/goflymake</p>
<p>go get github.com/tealeg/xlsx<br>go get github.com/mattn/go-sqlite3<br>输入下面命令安装pavucontrol：</p>
<p> #sudo apt install pavucontrol</p>
<p>#pavucontrol<br>打开选项卡后进行:<br>“回放”–&gt;系统下面的选项–&gt;内置音频模拟立体声<br>“输出设备”–&gt;port：headphone(unplugged) 模拟耳机</p>
<p>www.express-vpn.store</p>
<p><a href="http://ipaddress.com/" target="_blank" rel="external">http://ipaddress.com/</a>  136.243.89.5<br>        github.com<br>151.101.44.249    github.global.ssl.fastly.net</p>
<p>$ sudo apt-add-repository ppa:ubuntu-elisp/ppa<br>sudo apt upgrade<br>sudo apt update<br>$ sudo apt install emacs-snapshot emacs-snapshot-el</p>
<p>mv ~/.emacs.d ~/.emacs.bak<br>git clone git@github.com:syl20bnr/spacemacs.git ~/.emacs.d</p>
<p>git checkout –track checkversion/develop</p>
<p>emacs –insecure<br>安装Source Code Pro 字体<br>只clone release 分支，很重要，否则字体是乱码,体积也很大<br>[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype<br>git clone –depth 1 –branch release git@github.com:adobe-fonts/source-code-pro.git scp<br>sudo mv /usr/share/fonts/opentype/scp<br>sudo fc-cache -f -v</p>
<p>由于码农的洁癖，老版本必须删除。先查看安装包的名称：<br>dpkg -S emacs<br>再全部删除：<br>apt-get remove emacs24-bin-common emacs24-common emacs24-common-non-dfsg emacs24-nox<br>gsettings set com.canonical.Unity.Launcher launcher-position Bottom</p>
<p>安装WPS for Linux。下载地址：<a href="http://community.wps.cn/download/。选择alpha版deb包。" target="_blank" rel="external">http://community.wps.cn/download/。选择alpha版deb包。</a></p>
<p>   Linux 64 bit需要通过安装32 bit的库来获得支持。</p>
<p>   #sudo apt-get install ia32-libs</p>
<p>   但是输入命令后系统提示ia32-libs软件包缺失，需要用lib32ncurses5和lib32z1代替。于是运行</p>
<p>   #sudo apt-get install lib32ncurses5</p>
<p>   #sudo apt-get install lib32z1。</p>
<p>   再dpkg安装程序安装包</p>
<p>   #sudo dpkg -i wps-office_10.1.0.5672~a21_amd64.deb<br>   提示wps-office 依赖于 libpng12-0；然而：未安装软件包 libpng12-0。该软件包已丢失可用ttf-mscorefonts-installer代替。</p>
<p>   要先运行下面的命令将已安装的wps-office卸载：</p>
<p>   #apt-get -f install</p>
<p>   然后安装依赖关系：</p>
<p>   #sudp apt-get install ttf-mscorefonts-installer</p>
<p>   之后libpng12-0依赖关系还是出错，到下面的地址下载libpng12-0然后安装：</p>
<p>   <a href="https://packages.debian.org/zh-cn/wheezy/amd64/libpng12-0/download。" target="_blank" rel="external">https://packages.debian.org/zh-cn/wheezy/amd64/libpng12-0/download。</a></p>
<p>   #sudo dpkg -i libpng12-0_1.2.49-1+deb7u2_amd64.deb</p>
<p>   安装好后到Dash中搜索WPS启动并锁定到启动器，会报错显示缺失字体：</p>
<p>   Symbol，Wingdings，Wingdings2，Wingdings3，MT-Extra</p>
<p>   进入home文件夹，按Ctrl+h显示所有文件夹，查看有没有.fonts文件夹，如果没有就创建一个，然后到网上下载相关字体放入该文件夹中</p>
<p>7.安装vim编辑器。sudo apt-get install vim</p>
<p>8.安装unrar。sudo apt-get install rar unrar</p>
<p>9.删除Amazon的链接：sudo apt-get remove unity-webapps-common</p>
<p>10.安装Git：sudo apt-get install git</p>
<p>11.主题美化，安装Unity Tweak Tool：到Ubuntu软件中心搜索Unity Tweak Tool并安装</p>
<h3 id="wps-for-linux-安装出错-1"><a href="#wps-for-linux-安装出错-1" class="headerlink" title="wps for linux 安装出错"></a>wps for linux 安装出错</h3><h3 id="flyspell-出错的解决方案-1"><a href="#flyspell-出错的解决方案-1" class="headerlink" title="flyspell 出错的解决方案"></a>flyspell 出错的解决方案</h3><pre><code>sudo vi /etc/aspell.conf 
lang en
</code></pre><p>sudo apt install fcitx-table-wbpy<br>Ctrl+Alt+T （默认终端快捷键）打开终端，输入一下命令：<br>首先更改系统语言环境为英文<br>export LANG=en_US<br>然后更改设置<br>xdg-user-dirs-gtk-update<br>接着更改回中文语言环境<br>export LANG=zh_CN.UTF-8<br>再次执行<br>xdg-user-dirs-gtk-update<br>此时再次弹出界面，选择“保留旧的名称”</p>
<p>ssh-keygen -t rsa -C “email”</p>
<p>sudo add-apt-repository ppa:git-core/ppa<br>sudo apt-get update<br>sudo apt-get install git<br>[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype<br>sudo git clone –depth 1 –branch release git@github.com:adobe-fonts/source-code-pro.git /usr/share/fonts/opentype/scp<br>sudo fc-cache -f -v</p>
<p>sudo add-apt-repository ppa:ubuntu-elisp/ppa<br>sudo apt update<br>sudo apt install emacs-snapshot emacs-snapshot-el</p>
<p>mv ~/.emacs.d ~/Documents/.emacs.d.bak<br>git clone git@github.com:syl20bnr/spacemacs.git ~/.emacs.d<br>git checkout –track origin/develop<br>git pull –rebase</p>
<p>$xz -d <strong><em>.tar.xz<br>$tar -xvf  </em></strong>.tar 或</p>
<p> tar xvJf  <em>*</em>.tar.xz</p>
<p>sudo mv node-v7.2.0-linux-x64 /opt/node<br>ln -s /opt/node/bin/node /usr/local/bin/node<br>ln -s /opt/node/bin/npm /usr/local/bin/npm<br>node –version</p>
<p>vi ~/.bashrc<br>export NODE_HOME=/opt/node<br>export PATH=$PATH:$NODE_HOME/bin<br>export NODE_PATH=$PATH:$NODE_HOME/lib/node_modules<br>source ~/.bashrc<br>设置PATH后，hexo等全局插件运行才不会找不到文件。</p>
<p>tar zvxf go-<br>mv go- ~/<br>export GOROOT=$HOME/go<br>export GOBIN=$GOROOT/bin</p>
<h1 id="export-GOARCH-386-2"><a href="#export-GOARCH-386-2" class="headerlink" title="export GOARCH=386"></a>export GOARCH=386</h1><h1 id="export-GOOS-linux-2"><a href="#export-GOOS-linux-2" class="headerlink" title="export GOOS=linux"></a>export GOOS=linux</h1><p>export GOPATH=$HOME/gorepos<br>export PATH=$PATH:$GOROOT/bin:$GOPATH/bin<br>go version</p>
<p>vi ~/.emacs.d/init.el<br>(require ‘package)<br>(setq package-archives ‘((“gnu”   . “<a href="http://elpa.zilongshanren.com/gnu/" target="_blank" rel="external">http://elpa.zilongshanren.com/gnu/</a>“)<br>                         (“org”   . “<a href="http://elpa.zilongshanren.com/org/" target="_blank" rel="external">http://elpa.zilongshanren.com/org/</a>“)<br>                         (“melpa” . “<a href="http://elpa.zilongshanren.com/melpa/" target="_blank" rel="external">http://elpa.zilongshanren.com/melpa/</a>“)))<br>(package-initialize)</p>
<p>go 插件</p>
<p>go get -u -v github.com/nsf/gocode<br>go get -u -v github.com/rogpeppe/godef<br>go get -u -v github.com/zmb3/gogetdoc<br>go get -u -v github.com/golang/lint/golint<br>go get -u -v github.com/lukehoban/go-outline<br>go get -u -v sourcegraph.com/sqs/goreturns<br>go get -u -v golang.org/x/tools/cmd/gorename<br>go get -u -v github.com/tpng/gopkgs<br>go get -u -v github.com/newhook/go-symbols<br>go get -u -v golang.org/x/tools/cmd/guru<br>go get -u -v github.com/cweill/gotests/…</p>
<p>输入下面命令安装pavucontrol：</p>
<p> #sudo apt install pavucontrol</p>
<p>#pavucontrol<br>打开选项卡后进行:<br>“回放”–&gt;系统下面的选项–&gt;内置音频模拟立体声<br>“输出设备”–&gt;port：headphone(unplugged) 模拟耳机</p>
<p>$ sudo apt-add-repository ppa:ubuntu-elisp/ppa<br>sudo apt upgrade<br>sudo apt update<br>$ sudo apt install emacs-snapshot emacs-snapshot-el</p>
<p>mv ~/.emacs.d ~/.emacs.bak<br>git clone git@github.com:syl20bnr/spacemacs.git ~/.emacs.d</p>
<p>git checkout –track checkversion/develop</p>
<p>emacs –insecure<br>安装Source Code Pro 字体<br>只clone release 分支，很重要，否则字体是乱码,体积也很大<br>[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype<br>git clone –depth 1 –branch release git@github.com:adobe-fonts/source-code-pro.git scp<br>sudo mv /usr/share/fonts/opentype/scp<br>sudo fc-cache -f -v</p>
<p>由于码农的洁癖，老版本必须删除。先查看安装包的名称：<br>dpkg -S emacs<br>再全部删除：<br>apt-get remove emacs24-bin-common emacs24-common emacs24-common-non-dfsg emacs24-nox<br>gsettings set com.canonical.Unity.Launcher launcher-position Bottom</p>
<p>安装WPS for Linux。下载地址：<a href="http://community.wps.cn/download/。选择alpha版deb包。" target="_blank" rel="external">http://community.wps.cn/download/。选择alpha版deb包。</a></p>
<p>   Linux 64 bit需要通过安装32 bit的库来获得支持。</p>
<p>   #sudo apt-get install ia32-libs</p>
<p>   但是输入命令后系统提示ia32-libs软件包缺失，需要用lib32ncurses5和lib32z1代替。于是运行</p>
<p>   #sudo apt-get install lib32ncurses5</p>
<p>   #sudo apt-get install lib32z1。</p>
<p>   再dpkg安装程序安装包</p>
<p>   #sudo dpkg -i wps-office_10.1.0.5672~a21_amd64.deb<br>   提示wps-office 依赖于 libpng12-0；然而：未安装软件包 libpng12-0。该软件包已丢失可用ttf-mscorefonts-installer代替。</p>
<p>   要先运行下面的命令将已安装的wps-office卸载：</p>
<p>   #apt-get -f install</p>
<p>   然后安装依赖关系：</p>
<p>   #sudp apt-get install ttf-mscorefonts-installer</p>
<p>   之后libpng12-0依赖关系还是出错，到下面的地址下载libpng12-0然后安装：</p>
<p>   <a href="https://packages.debian.org/zh-cn/wheezy/amd64/libpng12-0/download。" target="_blank" rel="external">https://packages.debian.org/zh-cn/wheezy/amd64/libpng12-0/download。</a></p>
<p>   #sudo dpkg -i libpng12-0_1.2.49-1+deb7u2_amd64.deb</p>
<p>   安装好后到Dash中搜索WPS启动并锁定到启动器，会报错显示缺失字体：</p>
<p>   Symbol，Wingdings，Wingdings2，Wingdings3，MT-Extra</p>
<p>   进入home文件夹，按Ctrl+h显示所有文件夹，查看有没有.fonts文件夹，如果没有就创建一个，然后到网上下载相关字体放入该文件夹中</p>
<p>7.安装vim编辑器。sudo apt-get install vim</p>
<p>8.安装unrar。sudo apt-get install rar unrar</p>
<p>9.删除Amazon的链接：sudo apt-get remove unity-webapps-common</p>
<p>10.安装Git：sudo apt-get install git</p>
<p>11.主题美化，安装Unity Tweak Tool：到Ubuntu软件中心搜索Unity Tweak Tool并安装</p>
<h3 id="wps-for-linux-安装出错-2"><a href="#wps-for-linux-安装出错-2" class="headerlink" title="wps for linux 安装出错"></a>wps for linux 安装出错</h3><h3 id="flyspell-出错的解决方案-2"><a href="#flyspell-出错的解决方案-2" class="headerlink" title="flyspell 出错的解决方案"></a>flyspell 出错的解决方案</h3><pre><code>sudo vi /etc/aspell.conf 
lang en
</code></pre><p>作者：黄欢<br>链接：<a href="https://www.zhihu.com/question/47538279/answer/126170419" target="_blank" rel="external">https://www.zhihu.com/question/47538279/answer/126170419</a><br>来源：知乎<br>著作权归作者所有，转载请联系作者获得授权。</p>
<p>全局一个 gopath 和 每个项目一个单独的 gopath, 各有优缺点.<br>针对2种选择, 各推荐一个较优实践(欢迎分享更好的做法).</p>
<p>golang 官方文档里的选择:<br><a href="https://golang.org/doc/code.html" target="_blank" rel="external">https://golang.org/doc/code.html</a><br>对应中文文档:<br>如何使用Go编程</p>
<p>stackoverflow 上两种选择, 也是一半一半.<br>Whats a good best practice with Go workspaces?</p>
<p>———————— 全局一个 gopath 做法 ————————————-</p>
<p>我个人开发环境是设置一个 gopath, 配合 glide 管理.<br>全局一个 gopath 较优方案:<br>github管理源码 + glide(go 包管理工具)管理依赖包</p>
<p>glide 介绍:<br>1.是一个 golang 的包管理工具.</p>
<ol>
<li>功能类似 Python 的 pip + virtualenv. (个人理解)</li>
<li>可以锁定项目版本, 会在当前工程目录创建 vendor 目录, 存放所有依赖包.(可认为是个虚拟隔离环境)</li>
<li>默认优先从 vendor 下搜索依赖, 找不到, 再从全局 gopath 找.</li>
<li>这样不会污染全局的包(避免各项目依赖包版本冲突问题).<br>glide 工具: GitHub - Masterminds/glide: Package Management for Golang</li>
</ol>
<p>用法:<br>Getting Started<br>Golang 套件管理工具 Glide<br>glide使用 - golang</p>
<p>如何实践, 可以参考 gogs 项目对 glide 的应用:<br>GitHub - gogits/gogs: Gogs (Go Git Service) is a painless self-hosted Git service.</p>
<p>———————— 每个项目设置一个 gopath 推荐做法 ————————</p>
<p>per 项目 per gopath 推荐做法:<br>使用如下 脚本, 初始化.(非原创)</p>
<p>优点: </p>
<ol>
<li>自动创建 项目目录结构.</li>
<li>每个项目都是设置临时的 gopath, 避免污染全局的 gopath, 属于随用随初始化, 用完就扔那种. </li>
</ol>
<p>用法:</p>
<p>保存如下脚本内容到: create_go_proj.sh<br>执行如下命令, 创建项目初始工程目录:<br>sh ./create_go_proj.sh myproject</p>
<p>　　ubuntu上安装mysql非常简单只需要几条命令就可以完成。</p>
<p>　　1. sudo apt-get install mysql-server</p>
<p>　　2. apt-get isntall mysql-client</p>
<p>　　3.  sudo apt-get install libmysqlclient-dev</p>
<p>　　安装过程中会提示设置密码什么的，注意设置了不要忘了，安装完成之后可以使用如下命令来检查是否安装成功：</p>
<p>　　sudo netstat -tap | grep mysql</p>
<p>　　通过上述命令检查之后，如果看到有mysql 的socket处于 listen 状态则表示安装成功。</p>
<p>　　登陆mysql数据库可以通过如下命令：</p>
<p>　　mysql -u root -p </p>
<p>desc 表名;<br>show columns from 表名;<br>describe 表名;<br>show create table 表名;</p>
<p>use information_schema<br>select * from columns where table_name=’表名’;</p>
<p>show databases;<br>show tables;</p>
<p>mysqldump -h -u root -p db_name &gt; test_db.sql</p>
<p>sudo apt-get install vagrant<br>安装 vagrant virtual box</p>
<p><a href="https://www.virtualbox.org/wiki/Downloads" target="_blank" rel="external">https://www.virtualbox.org/wiki/Downloads</a></p>
<ul>
<li><p>host 屏幕百度</p>
<p>0.0.0.0 echarts.baidu.com<br>0.0.0.0 ubmcmm.baidustatic.com<br>0.0.0.0 bdimg.share.baidu.com<br>0.0.0.0 cpro.baidustatic.com<br>0.0.0.0 pos.baidu.com<br>0.0.0.0 hm.baidu.com<br>0.0.0.0 cb.baidu.com<br>0.0.0.0 cbjs.baidu.com<br>0.0.0.0 dup.baidustatic.com<br>0.0.0.0 bdimg.share.baidu.com<br>0.0.0.0 share.baidu.com<br>0.0.0.0 cpro.baidu.com<br>0.0.0.0 libs.baidu.com<br>0.0.0.0 siteapp.baidu.com<br>0.0.0.0 cpro.baidusstatic.com</p>
<p><a href="http://storage.core-os.net/coreos/amd64-usr/alpha/coreos_production_vagrant.box" target="_blank" rel="external">http://storage.core-os.net/coreos/amd64-usr/alpha/coreos_production_vagrant.box</a><br>/opt/mongodb/bin/mongodump -d pk10 -o ./datadump/ -u pk10 -p pk10888<br>/opt/mongodb/bin/mongodump -d pk10 -o ./datadump/ -u pk10 -p pk10888</p>
</li>
</ul>
<p>mongodump -u pk10 -password=pk10888  -d pk10  -o /home/www/pkcron/data<br>查看当前位置的全路径 pwd</p>
<p>5711435 江头<br>13859919326 张警官</p>
<p>/<em>      “tab_size”: 4,<br>    “translate_tabs_to_spaces”: true,</em>/</p>
<h1 id="go-xc766-com-一元云购"><a href="#go-xc766-com-一元云购" class="headerlink" title="go.xc766.com 一元云购"></a>go.xc766.com 一元云购</h1><h2 id="git-更新到最新版本的方法"><a href="#git-更新到最新版本的方法" class="headerlink" title="git 更新到最新版本的方法"></a>git 更新到最新版本的方法</h2><pre><code>添加git的ppa源
sudo apt-add-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
如果本地已经安装过Git，可以使用升级命令：
sudo apt-get dist-upgrade

gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error
出现这两个错误时用下面命令:
gpg --keyserver subkeys.pgp.net --recv-keys E1DF1F24
</code></pre><h2 id="nginx安装"><a href="#nginx安装" class="headerlink" title="nginx安装"></a>nginx安装</h2><pre><code>sudo apt-add-repository ppa:nginx/development
sudo apt-get update
sudo apt-get install nginx

ubuntu add-apt-repository: command not found 解决方案
sudo apt-get update
sudo apt-get install python-software-properties
sudo apt-get install software-properties-common
</code></pre><p>##安装mysql php5-mysql<br>    $ sudo apt-get install mysql-server php5-mysql<br>    安装过程会提示你为MySQL root 用户提供一个密码</p>
<p>##如果安装源出错，换成aliyun的源<br>        server apt-get update</p>
<p>##mysql 添加用户及授权<br>    CREATE USER ‘1yyg’@’localhost’ IDENTIFIED BY ‘123456’;<br>    mysql -u root -p;<br>    create database 1yyg;<br>    grant all privileges on 1yyg.* to 1yyg@localhost identified by ‘123456’;<br>    flush privileges;</p>
<p>##数据库导入<br>    mysql -u 1yyg -p;<br>    use 1yyg;<br>    set names ‘utf8’;<br>    source /目录/.sql;</p>
<h2 id="数据库导出"><a href="#数据库导出" class="headerlink" title="数据库导出"></a>数据库导出</h2><pre><code>mysqldump -u 1yyg -p密码 数据库名 &gt; 数据库名.sql
</code></pre><p>##php,nginx,mysql安装配置详见：<br><a href="http://blog.csdn.net/hanshileiai/article/details/45580001" target="_blank" rel="external">http://blog.csdn.net/hanshileiai/article/details/45580001</a></p>
<h2 id="补充php类库"><a href="#补充php类库" class="headerlink" title="补充php类库"></a>补充php类库</h2><pre><code>sudo apt-get install php5-gd  # Popular image manipulation library; used extensively by Wordpress and it&apos;s plugins.
sudo apt-get install php5-cli   # Makes the php5 command available to the terminal for php5 scripting
sudo apt-get install php5-curl    # Allows curl (file downloading tool) to be called from PHP5
sudo apt-get install php5-mcrypt   # Provides encryption algorithms to PHP scripts
sudo apt-get install php5-mysql   # Allows PHP5 scripts to talk to a MySQL Database
sudo apt-get install php5-readline  # Allows PHP5 scripts to use the readline function
</code></pre><p>##虚拟主机配置案例<br>    server{<br>            listen 80 ;<br>            server_name show.yunhor.com;<br>            location / {<br>               root /www/show.xc766.com;<br>               index index.html index.php;<br>             if (!-e $request_filename){<br>                 rewrite ^/(.*)$ /index.php?s=/$1 last;<br>                 break;<br>              }<br>            }<br>            location ~ .php$ {</p>
<pre><code>          #include snippets/fastcgi-php.conf;
            root /www/show.xc766.com;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }
}
</code></pre><h2 id="linux-tar实现分卷压缩与还原数据方法"><a href="#linux-tar实现分卷压缩与还原数据方法" class="headerlink" title="linux tar实现分卷压缩与还原数据方法"></a>linux tar实现分卷压缩与还原数据方法</h2><ol>
<li>分卷压缩<br> <code>tar cvzpf - eclipse | split -d -b 50m</code><br> <code>上面的命令是将eclipse这个文件夹分卷压缩，每卷50m，注意eclipse 前面有空格.压缩完之后，会被命名为x00,x01,x02...</code></li>
<li>解压<br> <code>首先需要合并：</code><br> <code>合并的命令是： cat x*&gt;eclipse.tar.gz</code><br> <code>然后解压：tar xzvf eclipse.tar.gz</code></li>
</ol>
<h2 id="markdown-语法"><a href="#markdown-语法" class="headerlink" title="markdown 语法"></a>markdown 语法</h2><p><a href="http://lutaf.com/markdown-simple-usage.htm" target="_blank" rel="external">一分钟学会Markdown 语法</a></p>
<p>##常用的git 操作<br>    git config –global user.name “aaa”<br>    git config –global user.email “aaa@abc.com”<br>    1没有参数 2–global 3–system<br>    ssh-keygen -t rsa -C “aaa@abc.com” 此处C是大写,生成之后将公钥贴上托管网站<br>    1.git init 目录名<br>    2.git remote add origin ssh://git@coding.net:yunhor/show.xc766.com.git<br>    3.git add .<br>    4.git commit -m “init commit”</p>
<pre><code>git clone git@coding.net:yunhor/show.xc766.git 目录名
git add -A --all . -u 文件名 文件名
git commit -m &quot;说明&quot;
git push origin master
git push origin aaa-bugfix-issue1:aaa-bugfix-issue1

git branch -a -r 查看分支 *字表示当前,红字表示远程的引用
git branch 分支名 创建一个本地分支,但不切换
git branch -d 分支名 删除 -D 强制删除
git branch -d -r origin/branch_name 删除远程分支引用
git push origin  :branch_name 删除远程分支
git checkout 分支名 切换分支,如果是远程分支名,还将新建一个同名的本地分支
git checkout -b 分支名 新建一个本地分支并切换到此分支
git remote -v 查看远程仓库注册

git fetch
git merge
git pull 切记要在正确的分支里,取回远程仓库的同名分支内容
切记,不要在本地的maters 操作git add  和git commit !!!
</code></pre><h2 id="github工作流"><a href="#github工作流" class="headerlink" title="github工作流"></a>github工作流</h2><p><a href="http://higrid.net/hi/docs/understanding-the-github-workflow" target="_blank" rel="external">深入理解github工作流</a></p>
<p>go build -ldflags “-s -w” hello.go<br>-s去掉符号表（然后panic时候的stack trace就没有任何文件名/行号信息了，这个等价于普通C/C++程序被strip的效果,<br>-w去掉DWARF调试信息，得到的程序就不能用gdb调试了。<br>-s和-w也可以分开使用，一般来说如果不打算用gdb调试，<br>-w基本没啥损失。-s的损失就有点大了。<br> sudo supervisord<br>sudo supervisorctl<br> sudo ps -ef | grep supervisor<br> 列出所有 tcp、udp 连接：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">这里是引用 代码</div></pre></td></tr></table></figure></p>
<p>?<br>1<br>2<br>lsof -i tcp;<br>lsof -i udp;</p>
<p>指定进程号，可以查看该进程打开的文件：<br> lsof -p 2064<br> 当你想要杀掉某个用户所有打开的文件、设备，你可以这样：<br>kill -9 <code>lsof -t -u lakshmanan</code><br>查看指定网口有哪些进程在使用：</p>
<h1 id="lsof-i-192-168-1-91"><a href="#lsof-i-192-168-1-91" class="headerlink" title="lsof -i@192.168.1.91"></a>lsof -i@192.168.1.91</h1><p>1、pmap命令<br>pmap pid  </p>
<p>2、ps命令<br>ps aux|grep process_name</p>
<p>动态查看一个进程的内存使用<br>1、top命令<br>top -d 1 -p pid [,pid …]  //设置为delay 1s，默认是delay 3s<br>如果想根据内存使用量进行排序，可以shift + m（Sort by memory usage） </p>
<p>go build -ldflags “-s -w” hello.go<br>-s去掉符号表（然后panic时候的stack trace就没有任何文件名/行号信息了，这个等价于普通C/C++程序被strip的效果,<br>-w去掉DWARF调试信息，得到的程序就不能用gdb调试了。<br>-s和-w也可以分开使用，一般来说如果不打算用gdb调试，<br>-w基本没啥损失。-s的损失就有点大了。<br> sudo supervisord<br>sudo supervisorctl<br> sudo ps -ef | grep supervisor<br> 列出所有 tcp、udp 连接：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">这里是引用 代码</div></pre></td></tr></table></figure></p>
<p>?<br>1<br>2<br>lsof -i tcp;<br>lsof -i udp;</p>
<p>指定进程号，可以查看该进程打开的文件：<br> lsof -p 2064<br> 当你想要杀掉某个用户所有打开的文件、设备，你可以这样：<br>kill -9 <code>lsof -t -u lakshmanan</code><br>查看指定网口有哪些进程在使用：</p>
<h1 id="lsof-i-192-168-1-91-1"><a href="#lsof-i-192-168-1-91-1" class="headerlink" title="lsof -i@192.168.1.91"></a>lsof -i@192.168.1.91</h1><p>1、pmap命令<br>pmap pid  </p>
<p>2、ps命令<br>ps aux|grep process_name</p>
<p>动态查看一个进程的内存使用<br>1、top命令<br>top -d 1 -p pid [,pid …]  //设置为delay 1s，默认是delay 3s<br>如果想根据内存使用量进行排序，可以shift + m（Sort by memory usage） </p>
<p>XMyh2014888<br>aliyun 密码<br>VNC连接密码： 702770</p>
<p>阿里云重装系统用更换系统盘</p>
<p><a href="http://demo.bossthemes.com/sneaker/intro/" target="_blank" rel="external">http://demo.bossthemes.com/sneaker/intro/</a><br>rosee35@163.com/xlh6688 邮箱密码<br>阿里云备案账号yunhor@163.com/crazy88,rosee35@163.com/rose888,13559073888@163.com/ltz888(邮箱密码13559073888)</p>
<p>e35.biz/备案密码crazymouse?</p>
<p><a href="http://hotelued.qunar.com/oniui/index.html" target="_blank" rel="external">http://hotelued.qunar.com/oniui/index.html</a></p>
<p>tongx.cn<br>yunhor.com<br>stonehui.com<br>stonehui.net<br>jiapuhui.cn<br>zupuhui.com<br>zupuhui.cn<br>zyxiean.com<br>ctyz.org<br>lazyrat.com</p>
<p>ltz57 121.40.124.34 2b664a9d<br>杭州 121.40.80.157/XMyh2014888<br>深圳 120.24.52.23 root XMyh2014888</p>
<p>====bash漏洞==============<br>可以使用如下命令来检查系统存在此漏洞：<br>env x=’() { :;}; echo vulnerable’ bash -c “echo this is a test”<br>受影响的系统包括：<br>CentOS<br>Debian<br>Redhat<br>Ubuntu<br>红帽系可通过更新 bash 并重启系统来解决这个问题：  </p>
<h1 id="yum-update-bash"><a href="#yum-update-bash" class="headerlink" title="yum update bash"></a>yum update bash</h1><p>或者：  </p>
<h1 id="yum-update-bash-4-1-2-15-el6-5-1"><a href="#yum-update-bash-4-1-2-15-el6-5-1" class="headerlink" title="yum update bash-4.1.2-15.el6_5.1"></a>yum update bash-4.1.2-15.el6_5.1</h1><p>此举只是更新了 bash 包，还需要重启系统才能生效。<br>Ubuntu 用户可以通过如下命令打补丁，无需重启：<br>apt-get update<br>apt-get install bash</p>
<p>安装后<br>[root@localhost ~]# env x=’() { :;}; echo vulnerable’ bash -c “echo this is a test”<br>bash: warning: x: ignoring function definition attempt<br>bash: error importing function definition for `x’<br>this is a test    </p>
<p>阿里云vps(ubuntu14.04 32位 lts)安装配置</p>
<p>安装nginx</p>
<p>sudo apt-get install software-properties-common<br>sudo apt-get install python-software-properties<br>sudo add-apt-repository ppa:nginx/development -y #或是stable稳定版<br>apt-get update<br>apt-get install nginx</p>
<p>nginx -t<br>nginx -s reload</p>
<p>安装nodejs</p>
<p>cd ~ &amp;&amp; mkdir downloads<br>cd downloads<br>wget <a href="http://nodejs.org/dist/v0.11.13/node-v0.11.13-linux-x86.tar.gz" target="_blank" rel="external">http://nodejs.org/dist/v0.11.13/node-v0.11.13-linux-x86.tar.gz</a><br>cd /opt<br>tar -xzvf ~/downloads/node-v0.11.13-linux-x86.tar.gz<br>mv node-v0.11.13-linux-x86 node<br>或<br>sudo cp -r node-v0.11.13  /opt/node<br>sudo vi /etc/profile.d/node.sh</p>
<p>  export NODE_HOME=/opt/node<br>  export PATH=$PATH:$NODE_HOME/bin<br>  export NODE_PATH=$PATH:$NODE_HOME/lib/node_modules</p>
<p>reboot</p>
<p>也可以<br>ln -s node-v0.11.13-linux-x86/bin/node /usr/local/bin/node<br>ln -s node-v0.11.13-linux-x86/bin/npm /usr/local/bin/npm</p>
<p>npm config set strict-ssl false<br> npm config set registry “<a href="http://registry.npmjs.org/" target="_blank" rel="external">http://registry.npmjs.org/</a>“<br>npm install -g cnpm –registry=<a href="http://r.cnpmjs.org" target="_blank" rel="external">http://r.cnpmjs.org</a></p>
<p>安装mongodb<br>cd ~/downloads<br>wget <a href="http://fastdl.mongodb.org/linux/mongodb-linux-i686-latest.tgz" target="_blank" rel="external">http://fastdl.mongodb.org/linux/mongodb-linux-i686-latest.tgz</a><br>cd /opt<br>tar xzvf ~/downloads/m<em>.tgz /opt/<br>move mon</em> mongodb<br>cd mongodb<br>mkdir datas logs</p>
<p>mongod<br>netstat -lanp|grep ‘27017’<br>vi /etc/init.d/rc.local或 etc/rc.d/rc.local</p>
<p>#rm -rf /opt/mongodb/datas/* &amp;&amp;<br>/opt/mongodb/bin/mongod –dbpath=/opt/mongodb/datas/ –logpath=/opt/mongodb/logs/mongo.log –logappend &amp;<br>ln -s /opt/mongodb/bin/mongo /usr/local/bin/mongo</p>
<p>32-bit servers don’t have journaling enabled by default. Please use –journal if you want durability.</p>
<p>这是告诉你32bit版本的mongodb默认不开journal记录，如果你需要的话，需要在运行时加上–journal开关</p>
<p>Linux目录/etc/init.d 与 /etc/rc.d/init.d</p>
<p>which git-shell 查看它的位置</p>
<p>git 安装配置</p>
<p>chmod 700 ~/.ssh 必须<br>chmod 600 ~/.ssh/authorized_keys 非必须<br>apt-get install git</p>
<p>sudo adduser gitusr<br>su gitusr<br>cd<br>mkdir .ssh<br>cat ~/.ssh/id_dsa.pub &gt;&gt; ~/.ssh/authorized_keys</p>
<p>sudo -u gitusr ssh-keygen -t rsa -C “jianl@example.com”<br>sud<br>ssh-keygen 会在~/.ssh目录下生成key对 id_rsa.pub和id_rsa<br>可以将pub发给服务器</p>
<p>以上可以快捷的为少数几个开发者架设一个可读写的git服务器<br>可以用Git自带的git-shell把git用户的活动限制在仅与git相关。把它设为git用户登入的Shell,那么该用户就不能拥有主机正常的 shell 访问权。为了实现这一点，需要指明用户的登入shell 是 git-shell ，而不是 bash 或者 csh。你可能得编辑 /etc/passwd 文件</p>
<p>sudo vim /etc/passwd</p>
<p>gitusr:x:1000:1000::/home/git:/bin/sh</p>
<p>gitusr:x:1000:1000::/home/git:/usr/bin/git-shell</p>
<p>现在 git 用户只能用 SSH 连接来推送和获取 Git 仓库，而不能直接使用主机 shell。</p>
<p>cd /var/www/yoursite<br>git init .<br>git config receive.denyCurrentBranch ignore<br>git config –bool receive.denyNonFastForwards false<br>git config –global user.name yunhor<br>git config –global user.email yunhor@163.com<br>cd .git/hooks<br>wget <a href="https://gist.githubusercontent.com/volca/9482044/raw/344a590af350b997db3819fa21426dfe8bc140f4/post-update" target="_blank" rel="external">https://gist.githubusercontent.com/volca/9482044/raw/344a590af350b997db3819fa21426dfe8bc140f4/post-update</a><br>chmod +x post-update<br>chown -R gitusr.gitusr www</p>
<p>首次提交完后<br>git checkout master<br>本地git版本库配置<br>[remote “prod”]<br>        url = your-ssh-username@your-host:/var/www/yoursite/</p>
<p> git remote add prod your-ssh-username@your-host:/var/www/yoursite/.git</p>
<p>git remote add prod gitusr@121.40.124.34:/home/www/ltz57</p>
<p>git remote add prod gitusr@121.40.80.157:/home/www/pk10<br>git remote add prod gitusr@120.24.52.23:/home/www/pk10</p>
<p>/opt/mongodb/bin/mongodump -d pk10 -o ./data/<br>git pull<br>git push prod master<br>git checkout master</p>
<p>注意事项</p>
<p>如果远程服务器上git的配置目录.git暴露在外部可访问的位置，请在web服务器上设置这个目录不可见。<br>为啥push成功之后，代码没有生效？<br>远程的git已经拥有所有的版本信息，但对应的HEAD节点还没有跟当前文档对应，你可以用SSH登录远程服务器之后git checkout master（或者你的分支），之后就无需再次checkout了。</p>
<p>本地的配置文件跟服务器配置文件不一样，怎么办？<br>善用.gitignore。</p>
<p>还有问题？<br>多多使用以下命令来检查git状态：</p>
<p>git status</p>
<p>git log –pretty=oneline</p>
<p>git remote</p>
<p>git branch</p>
<p>还有问题请google、stackoverflow……</p>
<p>cd /opt/git<br>mkdir project.git<br>cd project.git<br>git –bare init //远程服务器创建一个裸版本库</p>
<p>本地某用户<br>cd myproject<br>git init<br>git add .<br>git commit -m ‘initial commit’<br>git remote add origin git@gitserver:/opt/git/project.git<br>git push origin master</p>
<p>其它人也简单<br>git clone git@gitserver:/opt/git/project.git<br>vi README<br>git commit -am ‘fix for the README file.’<br>git push origin master</p>
<p>同时push到多个<br>[remote “all”]<br>url = git@github.com:licess/licess.git<br>url = git@gitcafe.com:licess/licess.git</p>
<p>git push all master</p>
<p>db.user.ensureIndex({“name”:1})</p>
<p>db.dxds5rec.ensureIndex({“BM”:1})</p>
<p>mongodump -d pk10db -o ./dump<br>tar zcvf pk10bak.tar.gz ./dump/pk10db<br>sz pk10bak.tar.gz<br>tar zxvf pk10bak.tar.gz ./<br>mongorestore –dbpath <database path=""> <path to="" the="" backup=""></path></database></p>
<p>192.168.2.1 admin/admin </p>
<p>XMyh2014888<br>aliyun 密码<br>VNC连接密码： 702770</p>
<p>阿里云重装系统用更换系统盘</p>
<p><a href="http://demo.bossthemes.com/sneaker/intro/" target="_blank" rel="external">http://demo.bossthemes.com/sneaker/intro/</a><br>rosee35@163.com/xlh6688 邮箱密码<br>阿里云备案账号yunhor@163.com/crazy88,rosee35@163.com/rose888,13559073888@163.com/ltz888(邮箱密码13559073888)</p>
<p>e35.biz/备案密码crazymouse?</p>
<p><a href="http://hotelued.qunar.com/oniui/index.html" target="_blank" rel="external">http://hotelued.qunar.com/oniui/index.html</a></p>
<p>tongx.cn<br>yunhor.com<br>stonehui.com<br>stonehui.net<br>jiapuhui.cn<br>zupuhui.com<br>zupuhui.cn<br>zyxiean.com<br>ctyz.org<br>lazyrat.com</p>
<p>ltz57 121.40.124.34 2b664a9d<br>杭州 121.40.80.157/XMyh2014888<br>深圳 120.24.52.23 root XMyh2014888</p>
<p>====bash漏洞==============<br>可以使用如下命令来检查系统存在此漏洞：<br>env x=’() { :;}; echo vulnerable’ bash -c “echo this is a test”<br>受影响的系统包括：<br>CentOS<br>Debian<br>Redhat<br>Ubuntu<br>红帽系可通过更新 bash 并重启系统来解决这个问题：  </p>
<h1 id="yum-update-bash-1"><a href="#yum-update-bash-1" class="headerlink" title="yum update bash"></a>yum update bash</h1><p>或者：  </p>
<h1 id="yum-update-bash-4-1-2-15-el6-5-1-1"><a href="#yum-update-bash-4-1-2-15-el6-5-1-1" class="headerlink" title="yum update bash-4.1.2-15.el6_5.1"></a>yum update bash-4.1.2-15.el6_5.1</h1><p>此举只是更新了 bash 包，还需要重启系统才能生效。<br>Ubuntu 用户可以通过如下命令打补丁，无需重启：<br>apt-get update<br>apt-get install bash</p>
<p>安装后<br>[root@localhost ~]# env x=’() { :;}; echo vulnerable’ bash -c “echo this is a test”<br>bash: warning: x: ignoring function definition attempt<br>bash: error importing function definition for `x’<br>this is a test </p>
<p>设置软件源镜像 <a href="http://mirrors.163.com/ubuntu" target="_blank" rel="external">http://mirrors.163.com/ubuntu</a></p>
<p>安装git</p>
<pre><code>apt-get install git
</code></pre><p>安装nvm<br>    git clone <a href="https://github.com/creationix/nvm.git" target="_blank" rel="external">https://github.com/creationix/nvm.git</a> ~/.nvm<br>    echo “source ~/.nvm/nvm.sh” &gt;&gt;~/.bashrc<br>    echo “source ~/.nvm/nvm.sh” &gt;&gt;~/.profile<br>nvm ls<br>nvm ls-remote<br>nvm install 0.10<br>nvm install 0.11<br>nvm use 0.10<br>nvm run 0.10 –version<br>nvm deactivate<br>nvm alias default 0.10</p>
<p>export NVM_NODEJS_ORG_MIRROR=<a href="http://nodejs.org/dist" target="_blank" rel="external">http://nodejs.org/dist</a><br>nvm install 0.10</p>
<p>NVM_NODEJS_ORG_MIRROR=<a href="http://nodejs.org/dist" target="_blank" rel="external">http://nodejs.org/dist</a> nvm install 0.10</p>
<p> npm –registry=<a href="http://r.cnpmjs.org" target="_blank" rel="external">http://r.cnpmjs.org</a> install cnpm -g</p>
<p>$ npm –registry=<a href="http://r.cnpmjs.org" target="_blank" rel="external">http://r.cnpmjs.org</a> install cnpm -g<br>通过 cnpm 命令行, 你可以快速同步任意模块:</p>
<p>$ cnpm sync koa connect mocha</p>
<p>一直 –registry=<a href="http://r.cnpmjs.org" target="_blank" rel="external">http://r.cnpmjs.org</a><br>npm config set registry=<a href="http://registry.npmjs.org" target="_blank" rel="external">http://registry.npmjs.org</a></p>
<p>npm config set registry <a href="https://registry.npm.taobao.org" target="_blank" rel="external">https://registry.npm.taobao.org</a><br>npm info underscore （如果上面配置正确这个命令会有字符串response）xmy</p>
<p>安装deb包：</p>
<p>sudo dpkg -i</p>
<p>安装jdk</p>
<p>1下载jdk 从首页进入，并且要从linux进入下载，不然下的包解压出错(之前用了QQ旋风下、、)<br>2.sudo tar zxvf ./jdk-8u11-linux-x64.tar.gz  -C /usr/lib/jvm<br>3.cd usr/lib/jvm sudo mv sudo mv jdk1.8.0_11/ java-8u11-sun<br>下面配置环境变量<br>使用vim ~/.bashrc命令编辑<br>6<br>在底部加入一下命令<br>export JAVA_HOME=/usr/lib/jvm/java-8u11-sun<br>export JRE_HOME=${JAVA_HOME}/jre<br>export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib<br>export PATH=${JAVA_HOME}/bin:$PATH </p>
<p>source ~/.bashrc </p>
<p>vi a i / x hjkl<br>Installing the Eclipse ADT Bundle<br>Android不支持64位系统，因此需要在Ubuntu64位系统下安装32位支持库。</p>
<p>下载安装ADT&amp;SDK<br>adt-bundle-linux-x86_64-20140702.zip<br>1<br>2<br>3<br>$ unzip adt-bundle-linux-x86_64-20140702.zip<br>$ cd adt-bundle-linux-x86_64-20140702/eclipse/<br>$ ./eclipse</p>
<p>Android SDK Manager下载所需的版本。</p>
<p>原因是Android不支持64位系统，因此需要在Ubuntu64位系统下安装32位支持库。</p>
<p>apt-get install ia32-libs<br>apt-get install lib32z1</p>
<p>AVD的分辨率不能设置太高，否则模拟器无法进入启动界面。</p>
<p>sudo apt-get install gedit</p>
<p>安装webstorm 8.0.4报java 环境错</p>
<p>//此处是命令打错 sudo ./webstorm.sh这样就不对 不带上sudo就ok了</p>
<p>JAVA环境变量设置正确的情况下，运行</p>
<p>export JDK_HOME=$JAVA_HOME</p>
<p>你也可以在打开eclipse之前，在终端输入 adb，回车，终端如果提示你：<br>       bash: /home/sherlock/developer/android/sdk/platform-tools/adb: 没有那个文件或目录<br>       这是因为Android SDK中的adb程序是32位的，Ubuntu x64系统需要安装32位库文件，用于兼容32位的程序。<br>   解决办法：<br>      在终端输入：<br>              sudo apt-get install -y libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1<br>       命令执行完后再在终端输入    adb<br>       终端会提示你<br>              程序“adb”尚未安装。 您可以使用以下命令安装：sudo apt-get install android-tools-adb<br>根据提示直接在终端输入：  sudo apt-get install android-tools-adb ，即可。</p>
<p>sudo add-apt-repository ppa:chris-lea/node.js<br>sudo apt-get update<br>sudo apt-get install nodejs<br>sudo npm install -g n<br>npm install -g cnpm –registry=<a href="http://r.cnpmjs.org" target="_blank" rel="external">http://r.cnpmjs.org</a></p>
<p>1、关闭npm的https<br>  npm config set strict-ssl false<br>2、设置npm的获取地址<br>  npm config set registry “<a href="http://registry.npmjs.org/" target="_blank" rel="external">http://registry.npmjs.org/</a>“<br>3、设置npm获取的代理服务器地址：<br>  npm config set proxy=<a href="http://代理服务器ip:代理服务器端口" target="_blank" rel="external">http://代理服务器ip:代理服务器端口</a><br>清除npm的代理命令如下：<br>  npm config delete http-proxy<br>  npm config delete https-proxy</p>
<p>最终发现cnpm其实是这么用的，我太傻了，还是cnpm靠谱<br>npm install -g cnpm –registry=<a href="http://r.cnpmjs.org" target="_blank" rel="external">http://r.cnpmjs.org</a><br>npm install microtime –registry=<a href="http://r.cnpmjs.org" target="_blank" rel="external">http://r.cnpmjs.org</a> –disturl=<a href="http://dist.cnpmjs.org" target="_blank" rel="external">http://dist.cnpmjs.org</a></p>
<p>npm install -g cnpm –registry=<a href="http://r.cnpmjs.org" target="_blank" rel="external">http://r.cnpmjs.org</a></p>
<p>v2ex.com</p>
<p>请使用gnupg(命令为gpg)，我干过这种事，如果觉得字符界面不方便的话，可以安装一些图形前端，比如kde下的kgpg或者kleopatra，不但可以加密字符串，而且可以加密二进制数据<br>ssh-keygen生成出来的密钥只能用来“验证”<br>而你需要的是“加密” </p>
<p>补充回答：<br>gpg绝对可以，我曾经用gpg加密过4.5G的DVD iso，不过，正如你知道的那样，公钥体制速度是巨慢的。<br>假设你已经创建了密钥对名称为abc， 要加密M07A0bpp-Duke.pdf<br>gpg -e -r abc M07A0bpp-Duke.pdf<br>将得到的M07A0bpp-Duke.pdf.gpg发送即可<br>当abc解密时，输入以下命令即可<br>gpg -u abc M07A0bpp-Duke.pdf.gpg<br>提问者评价<br>gpg非常好用，非常感谢你，以后也要照着我啊。。。</p>
<p>ssh-keygen -t rsa -C “email@abc.xxx” -f ~/.ssh/xxx<br>chmod 700 ~/.ssh 必须<br>chmod 600 ~/.ssh/authorized_keys 非必须</p>
<p>mongodump -d pk10db -o ./dump<br>tar zcvf pk10bak.tar.gz ./dump/pk10db<br>sz pk10bak.tar.gz<br>tar zxvf pk10bak.tar.gz ./<br>mongorestore –dbpath <database path=""> <path to="" the="" backup=""></path></database></p>
<p>StackOverflow</p>
<p>npm remove <name>移除</name></p>
<p>npm update <name>更新</name></p>
<p>tar 解压缩命令<br>tar</p>
<p>-c: 建立压缩档案<br>-x：解压<br>-t：查看内容<br>-r：向压缩归档文件末尾追加文件<br>-u：更新原压缩包中的文件</p>
<p>这五个是独立的命令，压缩解压都要用到其中一个，可以和别的命令连用但只能用其中一个。下面的参数是根据需要在压缩或解压档案时可选的。</p>
<p>-z：有gzip属性的<br>-j：有bz2属性的<br>-Z：有compress属性的<br>-v：显示所有过程<br>-O：将文件解开到标准输出</p>
<p>下面的参数-f是必须的</p>
<p>-f: 使用档案名字，切记，这个参数是最后一个参数，后面只能接档案名。</p>
<h1 id="tar-cf-all-tar-jpg"><a href="#tar-cf-all-tar-jpg" class="headerlink" title="tar -cf all.tar *.jpg"></a>tar -cf all.tar *.jpg</h1><p>这条命令是将所有.jpg的文件打成一个名为all.tar的包。-c是表示产生新的包，-f指定包的文件名。</p>
<h1 id="tar-rf-all-tar-gif"><a href="#tar-rf-all-tar-gif" class="headerlink" title="tar -rf all.tar *.gif"></a>tar -rf all.tar *.gif</h1><p>这条命令是将所有.gif的文件增加到all.tar的包里面去。-r是表示增加文件的意思。</p>
<h1 id="tar-uf-all-tar-logo-gif"><a href="#tar-uf-all-tar-logo-gif" class="headerlink" title="tar -uf all.tar logo.gif"></a>tar -uf all.tar logo.gif</h1><p>这条命令是更新原来tar包all.tar中logo.gif文件，-u是表示更新文件的意思。</p>
<h1 id="tar-tf-all-tar"><a href="#tar-tf-all-tar" class="headerlink" title="tar -tf all.tar"></a>tar -tf all.tar</h1><p>这条命令是列出all.tar包中所有文件，-t是列出文件的意思</p>
<h1 id="tar-xf-all-tar"><a href="#tar-xf-all-tar" class="headerlink" title="tar -xf all.tar"></a>tar -xf all.tar</h1><p>这条命令是解出all.tar包中所有文件，-x是解开的意思</p>
<p>压缩</p>
<p>tar –cvf jpg.tar *.jpg //将目录里所有jpg文件打包成tar.jpg</p>
<p>tar –czf jpg.tar.gz *.jpg   //将目录里所有jpg文件打包成jpg.tar后，并且将其用gzip压缩，生成一个gzip压缩过的包，命名为jpg.tar.gz</p>
<p>tar –cjf jpg.tar.bz2 *.jpg //将目录里所有jpg文件打包成jpg.tar后，并且将其用bzip2压缩，生成一个bzip2压缩过的包，命名为jpg.tar.bz2</p>
<p>tar –cZf jpg.tar.Z *.jpg   //将目录里所有jpg文件打包成jpg.tar后，并且将其用compress压缩，生成一个umcompress压缩过的包，命名为jpg.tar.Z</p>
<p>rar a jpg.rar *.jpg //rar格式的压缩，需要先下载rar for linux</p>
<p>zip jpg.zip *.jpg //zip格式的压缩，需要先下载zip for linux</p>
<p>解压</p>
<p>tar –xvf file.tar //解压 tar包</p>
<p>tar -xzvf file.tar.gz //解压tar.gz</p>
<p>tar -xjvf file.tar.bz2   //解压 tar.bz2</p>
<p>tar –xZvf file.tar.Z   //解压tar.Z</p>
<p>unrar e file.rar //解压rar</p>
<p>unzip file.zip //解压zip</p>
<p>总结</p>
<p>1、*.tar 用 tar –xvf 解压</p>
<p>2、*.gz 用 gzip -d或者gunzip 解压</p>
<p>3、<em>.tar.gz和</em>.tgz 用 tar –xzf 解压</p>
<p>4、*.bz2 用 bzip2 -d或者用bunzip2 解压</p>
<p>5、*.tar.bz2用tar –xjf 解压</p>
<p>6、*.Z 用 uncompress 解压</p>
<p>7、*.tar.Z 用tar –xZf 解压</p>
<p>8、*.rar 用 unrar e解压</p>
<p>9、*.zip 用 unzip 解压</p>
<p>sudo apt-get update sudo apt-get install -y unzip vim git-core curl wget build-essential python-software-properties<br>sudo add-apt-repository -y ppa:nginx/stable<br>sudo apt-get update sudo apt-get install -y nginx</p>
<p>本文来源：<a href="http://www.zzfly.net/ubuntu-hhvm-nginx-mysql/" target="_blank" rel="external">http://www.zzfly.net/ubuntu-hhvm-nginx-mysql/</a></p>
<p>sudo -s<br>nginx=stable # use nginx=development for latest development version<br>add-apt-repository ppa:nginx/$nginx<br>apt-get update<br>apt-get install nginx</p>
<p>add-apt-repository: command not found解决方案 </p>
<p>原因是缺少 python-software-properties，安装即可:<br>首先需要安装software-properties-common<br>$ sudo apt-get install software-properties-common<br>然后安装python-software-properties<br>$ sudo apt-get install python-software-properties<br>然后<br>sudo add-apt-repository ppa:nginx/stable<br>ok可以用了</p>
<p>sudo -s<br>nginx=stable # use nginx=development for latest development version<br>add-apt-repository ppa:nginx/$nginx<br>apt-get update<br>apt-get install nginx</p>
<p>sudo add-apt-repository ppa:nginx/stable<br>sudo apt-get update<br>//升级安装<br>sudo apt-get upgrade nginx -y<br>//初始安装<br>sudo apt-get install nginx</p>
<p>sudo /etc/init.d/nginx start</p>
<p>一.NodeJs安装</p>
<p>1.下载nodejs源码，这是目前最新版本</p>
<p><a href="http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz" target="_blank" rel="external">http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz</a></p>
<p>首先确保系统安装来python,gcc,g++,如果没有则安装： </p>
<p>$ sudo apt-get install python </p>
<p>$ sudo apt-get install build-essential </p>
<p>$ sudo apt-get install gcc </p>
<p>$ sudo apt-get install g++<br>3、其次，如果你计划在Node.js中启用网络加密，OpenSSL的加密库也是必须的。该加密库是libssl-dev，可以通过apt-get install libssl-dev等命令安装。 </p>
<p>2.解压安装包</p>
<p>tar -zxf node-v0.10.24.tar.gz<br>cd node-v0.10.22/</p>
<p>3.编译并安装</p>
<p>./configure –prefix=/opt/nodejs      #这里可以不指定目录，直接执行./configure命令也可以。<br>make                                              #这里有些慢，需要耐心等待<br>make install</p>
<p>4，测试安装</p>
<p>输入node –version测试是否安装成功，若显示版本号表示安装成功，以下是node相关参数</p>
<p>anwj@Anwj:~/nodejs$ node –help<br>Usage: node [options] [ -e script | script.js ] [arguments]<br>       node debug script.js [arguments] </p>
<p>Options:<br>  -v, –version        print node’s version<br>  -e, –eval script    evaluate script<br>  -p, –print          evaluate script and print result<br>  -i, –interactive    always enter the REPL even if stdin<br>                       does not appear to be a terminal<br>  –no-deprecation     silence deprecation warnings<br>  –trace-deprecation  show stack traces on deprecations<br>  –v8-options         print v8 command line options<br>  –max-stack-size=val set max v8 stack size (bytes)</p>
<p>二，npm(node package manager)</p>
<p>你只需要执行以下命令:<br>1.curl <a href="http://npmjs.org/install.sh" target="_blank" rel="external">http://npmjs.org/install.sh</a> | sh</p>
<p>如果安装过程中出现了权限问题,那么需要在 root 权限下执行上面的语句,或者使用sudo。<br>curl <a href="http://npmjs.org/install.sh" target="_blank" rel="external">http://npmjs.org/install.sh</a> | sudo sh<br>2其他安装方法,譬如从 git 中获取 npm 的最新分支,可以参考 <a href="http://npmjs.org/doc/README.html上的说明。" target="_blank" rel="external">http://npmjs.org/doc/README.html上的说明。</a></p>
<p>wget <a href="http://nodejs.org/dist/v0.6.1/node-v0.6.1.tar.gz" target="_blank" rel="external">http://nodejs.org/dist/v0.6.1/node-v0.6.1.tar.gz</a><br>tar zxvf node-v0.6.1.tar.gz<br>cd node-v0.6.1<br>./configure<br>上面几行命令是通过wget命令下载最新版本的代码，并解压之。<br>./configure命令将会检查环境是否符合Nodejs的编译需要。<br>Checking for program g++ or c++ : /usr/bin/g++  Checking for program cpp : /usr/bin/cpp  Checking for program ar : /usr/bin/ar  Checking for program ranlib : /usr/bin/ranlib  Checking for g++ : ok  Checking for program gcc or cc : /usr/bin/gcc  Checking for program ar : /usr/bin/ar  Checking for program ranlib : /usr/bin/ranlib  Checking for gcc : ok  Checking for library dl : yes  Checking for openssl : yes  Checking for library util : yes  Checking for library rt : yes  Checking for fdatasync(2) with c++ : yes </p>
<p>node.js在windows下有安装文件，直接一路下一步就可以了，但大家都知道在windows下用node.js总会遇到一些问题，所以就会用到linux。<br>看到网上几乎是在linux下编译安装node.js。感觉很奇怪，其实官网直接有  node.js linux  binaries文件。直接把文件解压复制到某个目录下，<br>加上路径就OK 了。</p>
<ol>
<li>sudo cp -r node-v0.10.28  /opt/node</li>
<li>sudo vi /etc/profile.d/node.sh<br>3.node.sh文件内容：<br>export NODE_HOME=/opt/node<br>export PATH=$PATH:$NODE_HOME/bin<br>export NODE_PATH=$PATH:$NODE_HOME/lib/node_modules<ol>
<li>重启电脑 ‘</li>
</ol>
</li>
</ol>
<p>简单说就是解压后，在bin文件夹中已经存在node以及npm，如果你进入到对应文件的中执行命令行一点问题都没有，不过不是全局的，所以将这个设置为全局就好了。</p>
<p>?<br>1<br>2<br>3<br>cd node-v0.10.28-linux-x64/bin<br>ls<br>./node -v<br>    这就妥妥的了，node文件夹具体放在哪，叫什么名字随你怎么定。然后设置全局：</p>
<p>?<br>1<br>2<br>ln -s /home/kun/mysofltware/node-v0.10.28-linux-x64/bin/node /usr/local/bin/node<br>ln -s /home/kun/mysofltware/node-v0.10.28-linux-x64/bin/npm /usr/local/bin/npm</p>
<p>这里/home/kun/mysofltware/这个路径是你自己放的，你将node文件解压到哪里就是哪里。</p>
<h1 id="tar-xvf-node-v0-10-28-tar-gz"><a href="#tar-xvf-node-v0-10-28-tar-gz" class="headerlink" title="tar xvf node-v0.10.28.tar.gz"></a>tar xvf node-v0.10.28.tar.gz</h1><h1 id="cd-node-v0-10-28"><a href="#cd-node-v0-10-28" class="headerlink" title="cd node-v0.10.28"></a>cd node-v0.10.28</h1><h1 id="configure"><a href="#configure" class="headerlink" title="./configure"></a>./configure</h1><h1 id="make"><a href="#make" class="headerlink" title="make"></a>make</h1><h1 id="make-install"><a href="#make-install" class="headerlink" title="make install"></a>make install</h1><h1 id="cp-usr-local-bin-node-usr-sbin"><a href="#cp-usr-local-bin-node-usr-sbin" class="headerlink" title="cp /usr/local/bin/node /usr/sbin/"></a>cp /usr/local/bin/node /usr/sbin/</h1><p>查看当前安装的Node的版本 </p>
<h1 id="node-v"><a href="#node-v" class="headerlink" title="node -v"></a>node -v</h1><p>v0.10.28</p>
<p>提示：加入路径的方式有多种，本文用的时添加.sh文件的方式，这种方式配置很方便，取消配置时删除.sh文件即可，但需要重启电脑。想用其它方式可以谷歌。</p>
<p>过去，我安装程序只会用apt-get install、yum install，或软件中心的工具来安装。</p>
<p>不过，在Linux下安装程序的最通用的方法是：</p>
<ol>
<li><p>从网上下载压缩的源码文件到本地</p>
<p>如果知道下载地址，可以使用wget命令来下载到当前目录或直接用浏览器下载到 ~/Downloads 。</p>
<blockquote>
<p>wget &lt;下载网址&gt;</p>
</blockquote>
</li>
<li><p>使用tar进行解压</p>
<blockquote>
<p>tar zxvf xxxxx.tar.gz</p>
</blockquote>
</li>
<li><p>进入源码文件目录</p>
<blockquote>
<p>cd xxxxx</p>
</blockquote>
</li>
<li><p>配置</p>
<blockquote>
<p>./configure</p>
</blockquote>
<p>系统会检查环境变量与相关的软件是否都具备。差什么就安装什么，安装方法重复1步骤。</p>
</li>
<li><p>编程程序源代码</p>
<blockquote>
<p>make</p>
</blockquote>
</li>
<li><p>安装软件到指定目录</p>
<blockquote>
<p>sudo make install</p>
</blockquote>
<p>这里一定要使用root权限或sudo来执行，否则会报错。</p>
</li>
<li><p>完成</p>
</li>
</ol>
<p>安装nginx</p>
<p>sudo apt-get install software-properties-common<br>sudo apt-get install python-software-properties<br>sudo add-apt-repository ppa:nginx/development -y 或是stable<br>apt-get update<br>apt-get install nginx</p>
<p>安装nodejs<br>wget <a href="http://http://nodejs.org/dist/v0.11.13/node-v0.11.13-linux-x86.tar.gz" target="_blank" rel="external">http://http://nodejs.org/dist/v0.11.13/node-v0.11.13-linux-x86.tar.gz</a></p>
<ol>
<li>sudo cp -r node-v0.11.13  /opt/node</li>
<li>sudo vi /etc/profile.d/node.sh<br>3.node.sh文件内容：<br>export NODE_HOME=/opt/node<br>export PATH=$PATH:$NODE_HOME/bin<br>export NODE_PATH=$PATH:$NODE_HOME/lib/node_modules<ol>
<li>重启电脑<br>也可以<br>ln -s /home/kun/mysofltware/node-v0.10.28-linux-x64/bin/node /usr/local/bin/node<br>ln -s /home/kun/mysofltware/node-v0.10.28-linux-x64/bin/npm /usr/local/bin/npm</li>
</ol>
</li>
</ol>
<p>这里/home/kun/mysofltware/这个路径是你自己放的，你将node文件解压到哪里就是哪里。<br>npm install -g cnpm –registry=<a href="http://r.cnpmjs.org" target="_blank" rel="external">http://r.cnpmjs.org</a></p>
<p>安装mongodb</p>
<p>wget <a href="http://fastdl.mongodb.org/linux/mongodb-linux-i686-latest.tgz" target="_blank" rel="external">http://fastdl.mongodb.org/linux/mongodb-linux-i686-latest.tgz</a><br>tar xf<br>tar xzvf ~/downloads/m<em>.tgz /opt/<br>mv mon</em> mongodb<br>cd opt/mongodb<br>mkdir datas logs</p>
<p>mongod<br>netstat -lanp|grep ‘27017’<br>vi /etc/init.d/rc.local或 etc/rc.d/rc.local<br>rm -rf /opt/mongodb/datas/* &amp;&amp; /opt/mongodb/bin/mongod –dbpath=/opt/mongodb/datas/ –logpath=/opt/mongodb/logs/mongo.log –logappend &amp;<br>ln -s /opt/mongodb/bin/mongo /usr/local/bin/mongo</p>
<p>32-bit servers don’t have journaling enabled by default. Please use –journal if you want durability.</p>
<p>这是告诉你32bit版本的mongodb默认不开journal记录，如果你需要的话，需要在运行时加上–journal开关<br>Linux目录/etc/init.d 与 /etc/rc.d/init.d</p>
<p>which git-shell 查看它的位置</p>
<p>git 安装配置<br>apt-get install git<br>mkdir ~/.ssh<br>cat ~/.ssh/id_dsa.pub &gt;&gt; ~/.ssh/authorized_keys</p>
<p>sudo -u apache ssh-keygen -t rsa -C “jianl@example.com”</p>
<p>ssh-keygen 会在~/.ssh目录下生成key对 id_rsa.pub和id_rsa<br>可以将pub发给服务器</p>
<p>sudo adduser git<br>su git<br>cd<br>mkdir .ssh<br>cat /tmp/id_rsa.<em>*</em>.pub&gt;&gt;~/.ssh/authorized_keys</p>
<p>cd /opt/git<br>mkdir project.git<br>cd project.git<br>git –bare init //远程服务器创建一个裸版本库</p>
<p>本地某用户<br>cd myproject<br>git init<br>git add .<br>git commit -m ‘initial commit’<br>git remote add origin git@gitserver:/opt/git/project.git<br>git push origin master</p>
<p>其它人也简单<br>git clone git@gitserver:/opt/git/project.git<br>vi README<br>git commit -am ‘fix for the README file.’<br>git push origin master</p>
<p>以上可以快捷的为少数几个开发者架设一个可读写的git服务器<br>可以用Git自带的git-shell把git用户的活动限制在仅与git相关。把它设为git用户登入的Shell,那么该用户就不能拥有主机正常的 shell 访问权。为了实现这一点，需要指明用户的登入shell 是 git-shell ，而不是 bash 或者 csh。你可能得编辑 /etc/passwd 文件</p>
<p>sudo vim /etc/passwd</p>
<p>git:x:1000:1000::/home/git:/bin/sh</p>
<p>git:x:1000:1000::/home/git:/usr/bin/git-shell</p>
<p>现在 git 用户只能用 SSH 连接来推送和获取 Git 仓库，而不能直接使用主机 shell。尝试登录的话，你会看到下面这样的拒绝信息：</p>
<p>cd /var/www/yoursite<br>git init .<br>git config receive.denyCurrentBranch ignore<br>git config –bool receive.denyNonFastForwards false<br>cd .git/hooks<br>wget <a href="https://gist.githubusercontent.com/volca/9482044/raw/344a590af350b997db3819fa21426dfe8bc140f4/post-update" target="_blank" rel="external">https://gist.githubusercontent.com/volca/9482044/raw/344a590af350b997db3819fa21426dfe8bc140f4/post-update</a><br>chmod +x post-update</p>
<p>本地git版本库配置<br>[remote “prod”]<br>        url = your-ssh-username@your-host:/var/www/yoursite/</p>
<p> git remote add prodyour-ssh-username@your-host:/var/www/yoursite/.git</p>
<p>git pull<br>git push prod</p>
<p>注意事项</p>
<p>如果远程服务器上git的配置目录.git暴露在外部可访问的位置，请在web服务器上设置这个目录不可见。</p>
<p>为啥push成功之后，代码没有生效？<br>远程的git已经拥有所有的版本信息，但对应的HEAD节点还没有跟当前文档对应，你可以用SSH登录远程服务器之后git checkout master（或者你的分支），之后就无需再次checkout了。</p>
<p>本地的配置文件跟服务器配置文件不一样，怎么办？<br>善用.gitignore。</p>
<p>还有问题？<br>多多使用以下命令来检查git状态：</p>
<p>git status</p>
<p>git log –pretty=oneline</p>
<p>git remote</p>
<p>git branch</p>
<p>还有问题请google、stackoverflow……</p>
<p>git push prod master</p>
<p> GitHub Flow 流程</p>
<p>xshell sftp 使用22端口<br>关于如何在Linux与linux，以及linux与windows之前传输文件，如下</p>
<p>sftp:/home/test&gt; help</p>
<p>bye　　 finish your SFTP session<br>cd 　　 change your remote working directory<br>clear 　 clear screen<br>exit 　  finish your SFTP session<br>explore explore your local directory<br>get 　　 download a file from the server to your local machine<br>help 　　 give help<br>lcd 　　 change and/or print local working directory<br>lls 　　 list contents of a local directory<br>lpwd 　print your local working directory<br>ls 　　 list contents of a remote directory<br>mkdir    create a directory on the remote server<br>mv  　　move or rename a file on the remote server<br>put 　　 upload a file from your local machine to the server<br>pwd 　　 print your remote working directory<br>quit 　　 finish your SFTP session<br>rename 　　 move or rename a file on the remote server<br>rm 　　 delete a file<br>rmdir 　　 remove a directory on the remote server</p>
<p>sftp:/home/test&gt;</p>
<p>这里主要是介绍windows与linux文件传输，其中比较常用的命令如下：</p>
<p>1、get</p>
<p>从远程服务器上下载一个文件存放到本地，如下：</p>
<p>先通过lcd切换到本地那个目录下，然后通过get file</p>
<blockquote>
<blockquote>
<p>lcd d:\             //表示切换到本地的d盘下</p>
<p>get ./test.sql　　//这样就将当前文件下载本地的d盘下</p>
</blockquote>
</blockquote>
<p>2、put</p>
<p>是将本地的文件上传到远程服务器上，如下：</p>
<blockquote>
<blockquote>
<p> put        //在windows下弹出选择文件的窗口</p>
</blockquote>
</blockquote>
<p>3、lcd</p>
<p>先通过lcd切换到本地那个目录下</p>
<blockquote>
<blockquote>
<p>lcd d:\             //表示切换到本地的d盘下</p>
</blockquote>
</blockquote>
<p>4、lls</p>
<p>显示当前目录下的所有文件</p>
<p>5、pwd</p>
<p>显示当前目录</p>
<h3 id="emacs-安装配置"><a href="#emacs-安装配置" class="headerlink" title="emacs 安装配置"></a>emacs 安装配置</h3><h3 id="melpa配置"><a href="#melpa配置" class="headerlink" title="melpa配置"></a>melpa配置</h3><p>修改～/.emacs<br><code>(require &#39;package)
(add-to-list &#39;package-archives
             &#39;(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)
(when (&lt; emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list &#39;package-archives &#39;(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))
(package-initialize)</code><br>M-x list-packages<br>i,u,d,x,r</p>
<h3 id="字体设置"><a href="#字体设置" class="headerlink" title="字体设置"></a>字体设置</h3><p>菜单 Options-&gt;设置Default fonts-&gt; 选择字体和字号-&gt;保存Options　</p>
<h3 id="安装go-mode"><a href="#安装go-mode" class="headerlink" title="安装go-mode"></a>安装go-mode</h3><p>用melpa安装　M-x list-packages,i,x</p>
<h3 id="gocode安装"><a href="#gocode安装" class="headerlink" title="gocode安装"></a>gocode安装</h3><p>先安装　autocomplete插件<br>再安装　go get  github.com/nsf/gocode<br>export PATH=$PATH:$GOPATH/bin</p>
<h3 id="安装gocode-src-emacs下的-go-autocomplete"><a href="#安装gocode-src-emacs下的-go-autocomplete" class="headerlink" title="安装gocode/src/emacs下的　go-autocomplete"></a>安装gocode/src/emacs下的　go-autocomplete</h3><p>将go-autocomplete.el拷至autocomplete目录里，配置<br><code>(require &#39;go-autocomplete)
(require &#39;auto-complete-config)
(ac-config-default)</code></p>
<h3 id="启动器启动时gocode出错，暂时用命令emacs打开"><a href="#启动器启动时gocode出错，暂时用命令emacs打开" class="headerlink" title="启动器启动时gocode出错，暂时用命令emacs打开"></a>启动器启动时gocode出错，暂时用命令emacs打开</h3><p>不要在.bashrc时加gocode -s,用命令行打开emacs时会自动加载gocode守护进程</p>
<p>软件中心 -&gt;卸载-&gt;deb安装-&gt;插件扩展并没有丢失直接用</p>
<p>setting user<br>{<br>    “color_scheme”: “Packages/Monokai Extended/Monokai Extended.tmTheme”,<br>    “font_face”: “YaHei Consolas Hybrid”,<br>    “font_size”: 24.0,<br>    “highlight_line”: true,<br>    “highlight_modified_tabs”: true,<br>    “ignored_packages”:<br>    [<br>        “Markdown”,<br>        “Vintage”<br>    ],<br>    “tab_size”: 4,<br>    “translate_tabs_to_spaces”: true<br>}<br>go sublime</p>
<p>{<br>    “env”: {<br>            “GOROOT”: “/home/yunhor/go”,<br>             “GOPATH”: “/home/yunhor/gorepos/metronic:/home/yunhor/gorepos”<br>         },<br>    “fmt_tab_width”: 4<br> }<br>BracketHighlighter<br>Emmet<br>FileDiffs<br>GoSublime<br>Markdown Extended<br>Markdown Preview<br>MarkdownEditing<br>Monokai Extended<br>packageResourceViewer<br>plaintask<br>sidebarenhancements<br>sublime-htmlprettify<br>traillingspaces<br>vue syntax hightlight<br>sublimetext 中文输入问题依然不行</p>
<p>ctrl+`<br>sublime text2</p>
<p>import urllib2,os; pf=’Package Control.sublime-package’; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), ‘wb’ ).write( urllib2.urlopen( ‘<a href="http://sublime.wbond.net/" target="_blank" rel="external">http://sublime.wbond.net/</a>‘ +pf.replace( ‘ ‘,’%20’ )).read()); print( ‘Please restart Sublime Text to finish installation’)</p>
<p>sublime text3 </p>
<p>import urllib.request,os; pf = ‘Package Control.sublime-package’; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), ‘wb’).write(urllib.request.urlopen( ‘<a href="http://sublime.wbond.net/" target="_blank" rel="external">http://sublime.wbond.net/</a>‘ + pf.replace(‘ ‘,’%20’)).read())</p>
<p>安装sublime 插件<br>主题 monokai-extended  markdown-extended<br>GoSublime<br>设置golang 的st环境<br>{<br>    “env”: {<br>            “GOROOT”: “/home/yunhor/go”,<br>             “GOPATH”: “/home/yunhor/gorepos”<br>         }<br> }<br>FileDiffs<br>html-css-js prettify:<br>git clone <a href="https://github.com/victorporof/Sublime-HTMLPrettify.git" target="_blank" rel="external">https://github.com/victorporof/Sublime-HTMLPrettify.git</a> ~/.config/sublime-text-3/Packages/Sublime-HTMLPrettify</p>
<p>SidebarEnhancements<br>Bracket Highlighter 标签匹配高亮<br>Emmet 需要安装PyV8<br>PyV8安装很慢，手动下载 <a href="https://github.com/emmetio/pyv8-binaries" target="_blank" rel="external">https://github.com/emmetio/pyv8-binaries</a> 将解压包里的两文件解至 sublime-text-3/Installed Packages/PyV8/pyv8-linux64-p3目录里,要与Emmet的安装目录一致<br>不然打开st时总是一直loading pyv8，或是Emmet不能工作</p>
<p>PackageResourceViewer,<br>用ctrl-shift-p打开 PackageResourceViewer : Open Resource-&gt;Theme - Default-&gt;Default.sublimt-theme<br>搜索 sidebar_label，在 “class”: “sidebar_label” 后边加一行： “font.size”:18, 将字体大小设置为18，保存。<br>注意标点的全半角<br>如果觉得行间距太小，可以往上找下，有个class:”sidebartree”，调一下里边的rowpadding配置即可。</p>
<p>打开 Preferences-&gt;Settings-user 设置st3的缺省配置</p>
<p>{<br>    “color_scheme”: “Packages/Color Scheme - Default/Monokai.tmTheme”,<br>    “font_size”: 23.0,<br>    “highlight_line”: true,<br>    “highlight_modified_tabs”: true,<br>    “ignored_packages”:<br>    [<br>        “Vintage”<br>    ]<br>}<br>也可以规范tab的空格数 </p>
<p>“color_scheme”: “Packages/Color Scheme - Default/Monokai.tmTheme”,<br>    // 设置Courier New等宽字体，以便阅读<br>    “font_face”: “Courier New”,<br>    “font_size”: 12.0,<br>    // 使光标闪动更加柔和<br>    “caret_style”: “phase”,<br>    // 高亮当前行<br>    “highlight_line”: true,<br>    // 高亮有修改的标签<br>    “highlight_modified_tabs”: true,<br>    // 设置tab的大小为4<br>    “tab_size”: 4,<br>    // 使用空格代替tab<br>    “translate_tabs_to_spaces”: true,<br>    // 添加行宽标尺<br>    “rulers”: [80, 100],<br>    // 显示空白字符<br>    “draw_white_space”: “all”,<br>    // 保存时自动去除行末空白<br>    “trim_trailing_white_space_on_save”: true,<br>    // 保存时自动增加文件末尾换行<br>    “ensure_newline_at_eof_on_save”: true,<br>TrailingSpaces 高亮显示多余的空格和Tab<br>ColorPicker 调色盘<br>JsFormat javascript格式化<br>SublimeTmpl 快速生成文件模板<br>sublimeLinter 代码错误提示<br>Trmmer 自动删除这些不必要的空格<br>Snippets<br>MarkDown Editing,MarkDown Preview<br>Error loading syntax file，因为打开了md,关掉md再打开st就行了<br>IMESupport 中文输入框不跟随插件 不能安装<br>注释插件: DocBlockr<br>PlainTasks<br>sublimetext3 中文输入法<br>AutoBackups<br>HTMLBeautify<br>Bootstrap 3 Snippets<br>JavaScript Snippets<br>CSSComb css排序格式化</p>
<p>gcc -shared -o libsublime-imfix.so sublime_imfix.c  <code>pkg-config --libs --cflags gtk+-2.0</code> -fPIC<br>生成的libsublime-imfix.so cp 至/usr/lib<br>alias cnsubl=’LD_PRELOAD=/usr/lib/libsublime-imfix.so subl ‘<br>保存于～/.bashrc</p>
<p>sudo nano /etc/network/interfaces</p>
<p>loopback这个不用修改。修改真正网卡，比如我的：<br>auto p3p1<br>iface p3p1 inet static<br>address 192.168.1.10<br>netmask 255.255.255.0<br>gateway 192.168.1.1<br>dns-nameservers 192.168.1.1 202.106.0.20</p>
<p>v2ex.com</p>
<p>请使用gnupg(命令为gpg)，我干过这种事，如果觉得字符界面不方便的话，可以安装一些图形前端，比如kde下的kgpg或者kleopatra，不但可以加密字符串，而且可以加密二进制数据<br>ssh-keygen生成出来的密钥只能用来“验证”<br>而你需要的是“加密” </p>
<p>补充回答：<br>gpg绝对可以，我曾经用gpg加密过4.5G的DVD iso，不过，正如你知道的那样，公钥体制速度是巨慢的。<br>假设你已经创建了密钥对名称为abc， 要加密M07A0bpp-Duke.pdf<br>gpg -e -r abc M07A0bpp-Duke.pdf<br>将得到的M07A0bpp-Duke.pdf.gpg发送即可<br>当abc解密时，输入以下命令即可<br>gpg -u abc M07A0bpp-Duke.pdf.gpg<br>提问者评价<br>gpg非常好用，非常感谢你，以后也要照着我啊。。。</p>
<p>ssh-keygen -t rsa -C “email@abc.xxx” -f ~/.ssh/xxx<br>chmod 700 ~/.ssh 必须<br>chmod 600 ~/.ssh/authorized_keys 非必须</p>
<p>XMyh2014888<br>aliyun 密码<br>VNC连接密码： 702770</p>
<p>阿里云重装系统用更换系统盘</p>
<p><a href="http://demo.bossthemes.com/sneaker/intro/" target="_blank" rel="external">http://demo.bossthemes.com/sneaker/intro/</a><br>rosee35@163.com/xlh6688 邮箱密码<br>阿里云备案账号yunhor@163.com/crazy88,rosee35@163.com/rose888,13559073888@163.com/ltz888(邮箱密码13559073888)</p>
<p>e35.biz/备案密码crazymouse?</p>
<p><a href="http://hotelued.qunar.com/oniui/index.html" target="_blank" rel="external">http://hotelued.qunar.com/oniui/index.html</a></p>
<p>tongx.cn<br>yunhor.com<br>stonehui.com<br>stonehui.net<br>jiapuhui.cn<br>zupuhui.com<br>zupuhui.cn<br>zyxiean.com<br>ctyz.org<br>lazyrat.com</p>
<p>ltz57 121.40.124.34 2b664a9d<br>杭州 121.40.80.157/XMyh2014888<br>深圳 120.24.52.23 root XMyh2014888</p>
<p>====bash漏洞==============<br>可以使用如下命令来检查系统存在此漏洞：<br>env x=’() { :;}; echo vulnerable’ bash -c “echo this is a test”<br>受影响的系统包括：<br>CentOS<br>Debian<br>Redhat<br>Ubuntu<br>红帽系可通过更新 bash 并重启系统来解决这个问题：  </p>
<h1 id="yum-update-bash-2"><a href="#yum-update-bash-2" class="headerlink" title="yum update bash"></a>yum update bash</h1><p>或者：  </p>
<h1 id="yum-update-bash-4-1-2-15-el6-5-1-2"><a href="#yum-update-bash-4-1-2-15-el6-5-1-2" class="headerlink" title="yum update bash-4.1.2-15.el6_5.1"></a>yum update bash-4.1.2-15.el6_5.1</h1><p>此举只是更新了 bash 包，还需要重启系统才能生效。<br>Ubuntu 用户可以通过如下命令打补丁，无需重启：<br>apt-get update<br>apt-get install bash</p>
<p>安装后<br>[root@localhost ~]# env x=’() { :;}; echo vulnerable’ bash -c “echo this is a test”<br>bash: warning: x: ignoring function definition attempt<br>bash: error importing function definition for `x’<br>this is a test </p>
<p>阿里云vps(ubuntu14.04 32位 lts)安装配置</p>
<p>安装nginx</p>
<p>sudo apt-get install software-properties-common<br>sudo apt-get install python-software-properties<br>sudo add-apt-repository ppa:nginx/development -y #或是stable稳定版<br>apt-get update<br>apt-get install nginx</p>
<p>nginx -t<br>nginx -s reload</p>
<p>安装nodejs</p>
<p>cd ~ &amp;&amp; mkdir downloads<br>wget <a href="http://http://nodejs.org/dist/v0.11.13/node-v0.11.13-linux-x86.tar.gz" target="_blank" rel="external">http://http://nodejs.org/dist/v0.11.13/node-v0.11.13-linux-x86.tar.gz</a><br>cd /opt<br>tar -xzvf ~/downloads/node-v0.11.13-linux-x86.tar.gz<br>mv node-v0.11.13-linux-x86 node<br>或<br>sudo cp -r node-v0.11.13  /opt/node<br>sudo vi /etc/profile.d/node.sh</p>
<p>  export NODE_HOME=/opt/node<br>  export PATH=$PATH:$NODE_HOME/bin<br>  export NODE_PATH=$PATH:$NODE_HOME/lib/node_modules</p>
<p>reboot</p>
<p>也可以<br>ln -s node-v0.11.13-linux-x86/bin/node /usr/local/bin/node<br>ln -s node-v0.11.13-linux-x86/bin/npm /usr/local/bin/npm</p>
<p>npm install -g cnpm –registry=<a href="http://r.cnpmjs.org" target="_blank" rel="external">http://r.cnpmjs.org</a></p>
<p>安装mongodb</p>
<p>wget <a href="http://fastdl.mongodb.org/linux/mongodb-linux-i686-latest.tgz" target="_blank" rel="external">http://fastdl.mongodb.org/linux/mongodb-linux-i686-latest.tgz</a><br>tar xf<br>tar xzvf ~/downloads/m<em>.tgz /opt/<br>move mon</em> mongodb<br>cd opt/mongodb<br>mkdir datas logs</p>
<p>mongod<br>netstat -lanp|grep ‘27017’<br>vi /etc/init.d/rc.local或 etc/rc.d/rc.local<br>rm -rf /opt/mongodb/datas/* &amp;&amp; /opt/mongodb/bin/mongod –dbpath=/opt/mongodb/datas/ –logpath=/opt/mongodb/logs/mongo.log –logappend &amp;<br>ln -s /opt/mongodb/bin/mongo /usr/local/bin/mongo</p>
<p>32-bit servers don’t have journaling enabled by default. Please use –journal if you want durability.</p>
<p>这是告诉你32bit版本的mongodb默认不开journal记录，如果你需要的话，需要在运行时加上–journal开关</p>
<p>Linux目录/etc/init.d 与 /etc/rc.d/init.d</p>
<p>which git-shell 查看它的位置</p>
<p>git 安装配置</p>
<p>chmod 700 ~/.ssh 必须<br>chmod 600 ~/.ssh/authorized_keys 非必须<br>apt-get install git</p>
<p>sudo adduser gitusr<br>su gitusr<br>cd<br>mkdir .ssh<br>cat ~/.ssh/id_dsa.pub &gt;&gt; ~/.ssh/authorized_keys</p>
<p>sudo -u gitusr ssh-keygen -t rsa -C “jianl@example.com”</p>
<p>ssh-keygen 会在~/.ssh目录下生成key对 id_rsa.pub和id_rsa<br>可以将pub发给服务器</p>
<p>以上可以快捷的为少数几个开发者架设一个可读写的git服务器<br>可以用Git自带的git-shell把git用户的活动限制在仅与git相关。把它设为git用户登入的Shell,那么该用户就不能拥有主机正常的 shell 访问权。为了实现这一点，需要指明用户的登入shell 是 git-shell ，而不是 bash 或者 csh。你可能得编辑 /etc/passwd 文件</p>
<p>sudo vim /etc/passwd</p>
<p>gitusr:x:1000:1000::/home/git:/bin/sh</p>
<p>gitusr:x:1000:1000::/home/git:/usr/bin/git-shell</p>
<p>现在 git 用户只能用 SSH 连接来推送和获取 Git 仓库，而不能直接使用主机 shell。</p>
<p>cd /var/www/yoursite<br>git init .<br>git config receive.denyCurrentBranch ignore<br>git config –bool receive.denyNonFastForwards false<br>git config –global user.name yunhor<br>git config –global user.email yunhor@163.com<br>cd .git/hooks<br>wget <a href="https://gist.githubusercontent.com/volca/9482044/raw/344a590af350b997db3819fa21426dfe8bc140f4/post-update" target="_blank" rel="external">https://gist.githubusercontent.com/volca/9482044/raw/344a590af350b997db3819fa21426dfe8bc140f4/post-update</a><br>chmod +x post-update</p>
<p>首次提交完后<br>git checkout master<br>本地git版本库配置<br>[remote “prod”]<br>        url = your-ssh-username@your-host:/var/www/yoursite/</p>
<p> git remote add prod your-ssh-username@your-host:/var/www/yoursite/.git</p>
<p>git remote add prod gitusr@121.40.124.34:/home/www/ltz57</p>
<p>git remote add prod gitusr@121.40.80.157:/home/www/pk10<br>git pull<br>git push prod master<br>git checkout master</p>
<p>注意事项</p>
<p>如果远程服务器上git的配置目录.git暴露在外部可访问的位置，请在web服务器上设置这个目录不可见。<br>为啥push成功之后，代码没有生效？<br>远程的git已经拥有所有的版本信息，但对应的HEAD节点还没有跟当前文档对应，你可以用SSH登录远程服务器之后git checkout master（或者你的分支），之后就无需再次checkout了。</p>
<p>本地的配置文件跟服务器配置文件不一样，怎么办？<br>善用.gitignore。</p>
<p>还有问题？<br>多多使用以下命令来检查git状态：</p>
<p>git status</p>
<p>git log –pretty=oneline</p>
<p>git remote</p>
<p>git branch</p>
<p>还有问题请google、stackoverflow……</p>
<p>cd /opt/git<br>mkdir project.git<br>cd project.git<br>git –bare init //远程服务器创建一个裸版本库</p>
<p>本地某用户<br>cd myproject<br>git init<br>git add .<br>git commit -m ‘initial commit’<br>git remote add origin git@gitserver:/opt/git/project.git<br>git push origin master</p>
<p>其它人也简单<br>git clone git@gitserver:/opt/git/project.git<br>vi README<br>git commit -am ‘fix for the README file.’<br>git push origin master</p>
<p>同时push到多个<br>[remote “all”]<br>url = git@github.com:licess/licess.git<br>url = git@gitcafe.com:licess/licess.git</p>
<p>git push all master</p>
<p>db.user.ensureIndex({“name”:1})</p>
<p>db.dxds5rec.ensureIndex({“BM”:1})</p>
<p>mongodump -d pk10db -o ./dump<br>tar zcvf pk10bak.tar.gz ./dump/pk10db<br>sz pk10bak.tar.gz<br>tar zxvf pk10bak.tar.gz ./<br>mongorestore –dbpath <database path=""> <path to="" the="" backup=""></path></database></p>
<p>192.168.2.1 admin/admin</p>
<h3 id="win10-mbr-gt-gpt"><a href="#win10-mbr-gt-gpt" class="headerlink" title="win10 mbr=&gt;gpt"></a>win10 mbr=&gt;gpt</h3><p>Shift + F10 打开命令窗口<br>diskpart<br>list disk<br>select disk 0<br>clean<br>convert gpt</p>
<p>本文为Ubuntu 15.04安装参考文章，方法是一样的，可做为安装Ubuntu的总体教程，亲测能安装成功。<br>采用在线升级到Ubuntu 15.04的方法：<br>从Ubuntu 14.04/Ubuntu 14.10升级：<br>sudo apt-get update<br>sudo apt-get dist-upgrade<br>安装update-manager-core且可用，用下面的命令：<br>sudo apt-get install update-manager-core<br>sudo do-release-upgrade -d</p>
<p>ubuntu 14.04升级到14.10再升级到15.04两个阶段升花费好久时间不说，还将linux弄死了，启动不了，索性全新安装<br>其实可以用字符系统<br>ctrl+alt+f1,f2,查看出问题的进程，kill </p>
<p>uefi+gpt分区先设置bios,打开efi启动，先安装win10 64 启动到键盘选择时按 shift+f10打开命令窗口<br>执行命令 diskpart ,list disk ,select disk 0 ,clean ,convert gpt 这样就将硬盘更换为gpt分区格式<br>之后回到现在安装，选择自定义安装，系统会另外划分3个小分区：恢复、系统分区、msr(微软保留)<br>win10安装之后再安装 ubuntu 到另一块硬盘上，另外划分efi分区这样双系统就不会互相影响了，后装的linux,grub 2<br>会自动在菜单里加入win10的启动项。<br>u盘安装 用ultraiso写成 hdd+2 载入比较慢，分区efi 200m,swap 3g,boot分区10g ext4,/分区60g ext4 ，安装后重启关机会死机，是因为采用公版显卡驱动有些问题，软件与更新-&gt; 附加驱动 为n卡的私有驱动，tested 和Cpu驱动，问题解决<br>15.04新版感觉驱动更完善了，wifi似乎不用修改配置成不休眠，界面速度响应似乎更快了。</p>
<p>阿超科学上网的host 文件 <a href="http://awolau.com/" target="_blank" rel="external">http://awolau.com/</a><br>sudo /etc/init.d/networking restart</p>
<p>中文目录名改回英文：</p>
<p>export LANG=en_US<br>xdg-user-dirs-gtk-update<br>export LANG=zh_CN.UTF-8<br>重启后不要改为中文名</p>
<p>vivid没有改为国内源，用ubuntu国内服务器</p>
<p>chromium flash插件 下载安装后依然不能正常工作<br>原因是，之前Chromium使用Netscape Plugin API构架来支持Flash，从Ubuntu 14.04开始，Chromium将会停止使用Netscape Plugin API<br>修复这个问题，我们应该使用Pepper Flash Player，一个来自Google更安全更稳定的版本的Flash Player。在Ubuntu 14.04的源里有Adobe Flash Player Pepper 安装器。这个安装器会下载Google Chrome，提取出Pepper Flash Player然后设置给Chromium使用。</p>
<p>sudo apt-get install pepperflashplugin-nonfree<br>sudo update-pepperflashplugin-nonfree –install<br>之后重启Chromium。不用重启系统。</p>
<p>本地菜单很难点选，通过 外观-&gt;行为 改成显示窗口菜单 在菜单栏恢复成以前的顶部<br>sublimetext 中文输入问题依然不行</p>
<p>chromium 设置成打开新标签页，提高打开速度</p>
<p>go安装<br>vi ~/.bashrc<br>append :<br>export GOROOT=/home/yunhor/go<br>export GOPATH=/home/yunhor/workspace/repos<br>export PATH=$PATH:$GOROOT/bin</p>
<p>source ~/.bashrc</p>
<p>tar zxvf go1.4.2.linux-amd64.tar.gz<br>mv ./go /media/repos/</p>
<p>ctrl+`<br>sublime text2</p>
<p>import urllib2,os; pf=’Package Control.sublime-package’; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), ‘wb’ ).write( urllib2.urlopen( ‘<a href="http://sublime.wbond.net/" target="_blank" rel="external">http://sublime.wbond.net/</a>‘ +pf.replace( ‘ ‘,’%20’ )).read()); print( ‘Please restart Sublime Text to finish installation’)</p>
<p>sublime text3 </p>
<p>import urllib.request,os; pf = ‘Package Control.sublime-package’; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), ‘wb’).write(urllib.request.urlopen( ‘<a href="http://sublime.wbond.net/" target="_blank" rel="external">http://sublime.wbond.net/</a>‘ + pf.replace(‘ ‘,’%20’)).read())</p>
<p>安装sublime 插件<br>主题 monokai-extended  markdown-extended<br>GoSublime<br>设置golang 的st环境<br>{<br>    “env”: {<br>            “GOROOT”: “/media/yunhor/repos/go”,<br>             “GOPATH”: “/media/yunhor/repos/gorepos”<br>         }<br> }<br>FileDiffs<br>html-css-js prettify:<br>git clone <a href="https://github.com/victorporof/Sublime-HTMLPrettify.git" target="_blank" rel="external">https://github.com/victorporof/Sublime-HTMLPrettify.git</a> ~/.config/sublime-text-3/Packages/Sublime-HTMLPrettify</p>
<p>SidebarEnhancements<br>Bracket Highlighter 标签匹配高亮<br>Emmet 需要安装PyV8<br>PyV8安装很慢，手动下载 <a href="https://github.com/emmetio/pyv8-binaries" target="_blank" rel="external">https://github.com/emmetio/pyv8-binaries</a> 将解压包里的两文件解至 sublime-text-3/Installed Packages/PyV8/pyv8-linux64-p3目录里,要与Emmet的安装目录一致<br>不然打开st时总是一直loading pyv8，或是Emmet不能工作</p>
<p>PackageResourceViewer,<br>用ctrl-shift-p打开 PackageResourceViewer : Open Resource-&gt;Theme - Default-&gt;Default.sublimt-theme<br>搜索 sidebar_label，在 “class”: “sidebar_label” 后边加一行： “font.size”:18, 将字体大小设置为18，保存。<br>注意标点的全半角<br>如果觉得行间距太小，可以往上找下，有个class:”sidebartree”，调一下里边的rowpadding配置即可。</p>
<p>打开 Preferences-&gt;Settings-user 设置st3的缺省配置</p>
<p>{<br>    “color_scheme”: “Packages/Color Scheme - Default/Monokai.tmTheme”,<br>    “font_size”: 23.0,<br>    “highlight_line”: true,<br>    “highlight_modified_tabs”: true,<br>    “ignored_packages”:<br>    [<br>        “Vintage”<br>    ]<br>}<br>也可以规范tab的空格数 </p>
<p>“color_scheme”: “Packages/Color Scheme - Default/Monokai.tmTheme”,<br>    // 设置Courier New等宽字体，以便阅读<br>    “font_face”: “Courier New”,<br>    “font_size”: 12.0,<br>    // 使光标闪动更加柔和<br>    “caret_style”: “phase”,<br>    // 高亮当前行<br>    “highlight_line”: true,<br>    // 高亮有修改的标签<br>    “highlight_modified_tabs”: true,<br>    // 设置tab的大小为4<br>    “tab_size”: 4,<br>    // 使用空格代替tab<br>    “translate_tabs_to_spaces”: true,<br>    // 添加行宽标尺<br>    “rulers”: [80, 100],<br>    // 显示空白字符<br>    “draw_white_space”: “all”,<br>    // 保存时自动去除行末空白<br>    “trim_trailing_white_space_on_save”: true,<br>    // 保存时自动增加文件末尾换行<br>    “ensure_newline_at_eof_on_save”: true,<br>TrailingSpaces 高亮显示多余的空格和Tab<br>ColorPicker 调色盘<br>JsFormat javascript格式化<br>SublimeTmpl 快速生成文件模板<br>sublimeLinter 代码错误提示<br>Trmmer 自动删除这些不必要的空格<br>Snippets<br>MarkDown Editing,MarkDown Preview<br>Error loading syntax file，因为打开了md,关掉md再打开st就行了<br>IMESupport 中文输入框不跟随插件 不能安装<br>注释插件: DocBlockr<br>PlainTasks<br>sublimetext3 中文输入法<br>AutoBackups<br>HTMLBeautify<br>Bootstrap 3 Snippets<br>JavaScript Snippets<br>CSSComb css排序格式化</p>
<p>gcc -shared -o libsublime-imfix.so sublime_imfix.c  <code>pkg-config --libs --cflags gtk+-2.0</code> -fPIC<br>生成的libsublime-imfix.so cp 至/usr/lib<br>alias cnsubl=’LD_PRELOAD=/usr/lib/libsublime-imfix.so subl ‘<br>保存于～/.bashrc</p>
<p>ssh 生成 ssh-keygen -t rsa<br>为免重新添加known_hosts 将旧的密钥对覆盖新生成的就可以</p>
<p>安装xmind6 pro 3.5.2时出错，软件质量不好，压缩格式后缀无效 什么鬼？ 暂时装3.5.1<br>安装目录为/usr/lib/xmind 将破解文件覆盖plugins下同名文件</p>
<p>nodejs/iojs<br>tar zvxf node-v0.12.2-linux-x64.tar.gz<br>sudo mv node-v0.12.2-linux-x64 /opt/node<br>sudo ln -s /opt/node/bin/node /usr/local/bin/node<br>sudo ln -s /opt/node/bin/npm /usr/local/bin/npm<br>sudo npm install -g cnpm –registry=<a href="https://registry.npm.taobao.org" target="_blank" rel="external">https://registry.npm.taobao.org</a></p>
<p>解压tar.xz文件：先 xz -d xxx.tar.xz 将 xxx.tar.xz解压成 xxx.tar 然后，再用 tar xvf xxx.tar来解包。</p>
<p>sudo mv iojs-v2.0.1-linux-x64 /opt/iojs<br>sudo ln -s /opt/iojs/bin/iojs /usr/local/bin/iojs<br>sudo npm install -g cnpm –registry=<a href="https://registry.npm.taobao.org" target="_blank" rel="external">https://registry.npm.taobao.org</a></p>
<p>Y 拷贝到clipboard S+ins 粘贴到vim 或是+p命令</p>
<p>emacs 24.5 安装</p>
<p>sudo apt-get update<br>sudo apt-get upgrade</p>
<p> $ sudo apt-add-repository ppa:ubuntu-elisp/ppa</p>
<p> $ sudo apt-get install emacs-snapshot emacs-snapshot-el  记得不要加  emacs-snapshot-gtk 会出错</p>
<p>gocode</p>
<p>cp -r sdir ddir0</p>
<p>tar –exclude a/b -zcvf a.tar.gz a</p>
<p>apt-cache show supervisor<br>supervisord : supervisor的服务器端部分，启动supervisor就是运行这个命令</p>
<p>supervisorctl：启动supervisor的命令行窗口。<br>apt-get install nginx,supervisor</p>
<p>测试是否安装成功：</p>
<p>echo_supervisord_conf</p>
<p>创建配置文件：</p>
<p>echo_supervisord_conf &gt; /etc/supervisord.conf</p>
<p>修改配置文件：</p>
<p>在supervisord.conf最后增加：</p>
<p>[program:redis]</p>
<p>command = redis-server   //需要执行的命令</p>
<p>autostart=true    //supervisor启动的时候是否随着同时启动</p>
<p>autorestart=true   //当程序跑出exit的时候，这个program会自动重启</p>
<p>startsecs=3  //程序重启时候停留在runing状态的秒数<br>运行命令：</p>
<p>supervisord    //启动supervisor</p>
<p>supervisorctl   //打开命令行</p>
<p>[root@vm14211 ~]# supervisorctl<br>redis                            RUNNING    pid 24068, uptime 3:41:55</p>
<p>ctl中： help   //查看命令</p>
<p>ctl中： status  //查看状态<br>[program:dyzww]<br>autorestart=true<br>command= 这里写上面gunicorn 的command<br>directory= 网站所在的目录<br>process_name= top 中显示的进程名<br>redirect_stderr=true<br>stdot_logfile=log文件</p>
<h3 id="nfts分区mount出错的修复"><a href="#nfts分区mount出错的修复" class="headerlink" title="nfts分区mount出错的修复"></a>nfts分区mount出错的修复</h3><p>查看有没安装ntfs-3g？用以下命令修复 sdan<br>sudo ntfsfix /dev/sda6 </p>
<p>临时电话记录</p>
<p>黄宇杨 15960281586<br>黄明明 13400601681 厦门翼讯代理商 ltz57.com</p>
<p><a href="http://www.dsnyy.com/files/article/html/10/10868/3876709.html" target="_blank" rel="external">http://www.dsnyy.com/files/article/html/10/10868/3876709.html</a><br><a href="http://www.dsnyy.com/files/article/html/11/11660/4672373.html" target="_blank" rel="external">http://www.dsnyy.com/files/article/html/11/11660/4672373.html</a></p>
<p>13385925718 旧号码</p>
<p>ubuntu 截屏 1.PrtSc全屏至剪贴板 2.Shift+PrtSc 选择截取的区域</p>
<p>kazam =&gt;首选项=&gt;speaker要选择”内部音频,模拟立体声”才能录制系统播放的声音<br>sudo ifconfig wlan0 up<br>ifconfig -a<br>lspci -vv<br>关掉无线网卡电源节能 iwconfig wlan0 power off</p>
<p>Realtek RTL8723BE linux 掉线的问题<br>sudo modprobe -r rtl8723be<br>sudo modprobe rtl8723be -v ips=0 fwlps=0 swenc=1<br>开机加载:新建/etc/modprobe.d/rtl8723be.conf,添加 options rtl8723be ips=0 fwlps=0 swenc=1</p>
<p>或者<br>sudo echo “options rtl8723be fwlps=0 swlps=0” &gt; /etc/modprobe.d/rtl8723be.conf<br>sudo reboot </p>
<p>server端模拟client登陆socket.io<br>页面测试类工具, 如Selenautilus /media/nium之类的<br>爬虫类的或模拟网页访问类的： Phantomjs 、 CasperJS,cheerio<br>仅针对socket.io的服务端测试，也许可以用socket.io-client</p>
<p><a href="http://seleniumhq.org/" target="_blank" rel="external">http://seleniumhq.org/</a><br><a href="http://phantomjs.org/" target="_blank" rel="external">http://phantomjs.org/</a><br><a href="http://casperjs.org/" target="_blank" rel="external">http://casperjs.org/</a><br><a href="https://github.com/LearnBoost/socket.io-client" target="_blank" rel="external">https://github.com/LearnBoost/socket.io-client</a></p>
<p>socket.io-client 是可以单独使用的, 我有用过。<br>Selenium 是传统的页面测试工具，以前用的比较多的是它的JAVA类库。<br>CasperJS(对phantomjs进行封装)，多用来做爬虫，比起httpclient，jsdom，node.io，request这些类库的而言，它的优点在于： headless webkit，基于QTWEBKIT的浏览器，不需要自行处理跳转（304或window.location之类），而后者只是模拟http协议而已。</p>
<p>cherrio<br>一般用request &amp; cherrio基本就没问题了，有ajax的上phantomjs<br>对于ajax的页面，我只好用phantom了。。。但也遇到和楼主一样的困惑，非得将数据拉下来写文件，再让node拿，感觉好不爽。至于解析dom，推荐cherrio</p>
<p>人均网购每年支出是1000美元，如果我们假设美国人的年均可支配收入是4万美元，那么剩下的3.9万美元花到哪儿去了？咖啡店、酒吧、健身房、餐厅、加油站、水电工、干洗店和发廊。</p>
<p>1.2rc1 以后沒有 go doc 指令, 只留下 godoc 指令<br>1.5正式发布</p>
<p><a href="http://www.lecai.com/lottery/pk10/" target="_blank" rel="external">http://www.lecai.com/lottery/pk10/</a></p>
<p>2015-08-21 购买4核阿里云4820 </p>
<p>/opt/mongodb/bin/mongod –dbpath=/opt/mongodb/datas/ –logpath=/opt/mongodb/logs/mongo.log –logappend &amp;</p>
<p>db.rec.aggregate([{$group:{_id:”$strDate”,count:{$sum:1}}},{$sort:{count:1}}])</p>
<p>联通手机实名认证<br>铁通手机实名认证</p>
<p>sudo ufw allow 9000</p>
<p>120.25.57.234 新主机,深圳 XMyh2015888<br>115.159.84.94 腾讯云 上海 ubuntu/ xmyh2016888</p>
<p>qcloud.com qq账号<br>nc 115.159.84.94 9000</p>
<p>sudo passwd ubuntu<br>netstat –apn | grep 8080</p>
<p>mongodb 2.6.1 以后<br>db.createUser({user:”sa”,pwd:”xmyh2015886”,roles:[{role:”userAdminAnyDatabase”,db:”admin”}]})<br>mongo localhost/admin -u sa -p xmyh2015886<br>use pk10<br>db.createUser({user:”pk10”,pwd:”pk10888”,roles:[{role:”dbOwner”,db:”pk10”}]})<br>db.createUser({user:”pk10”,pwd:”pk10888”,roles:[{role:”dbOwner”,db:”pk10”}]})</p>
<p>VS Code 安装插件</p>
<pre><code>go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-find-references
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/derekparker/delve/cmd/dlv
</code></pre><p>升级git</p>
<pre><code>sudo apt-add-repository ppa:git-core/ppa  
sudo apt-get update  
sudo apt-get install git  


如果本地已经安装过Git，可以使用升级命令：
</code></pre><p>[plain] view plaincopy</p>
<pre><code>sudo apt-get dist-upgrade  
</code></pre><p>fc -list:lang=zh-cn 查看可用的中文字体</p>
<p>命令行以窗口打开目录<br>nautilus /media/</p>
<p>show 413文件太大错误<br>vi /etc/php5/fpm/php.ini<br>post_max_size = 100M<br>upload_max_filesize = 100M<br>vi /etc/nginx/nginx.conf<br>client_max_body_size 100m;<br>/etc/init.d/php5-fpm restart<br>nginx -s reload</p>
<p>用service php5-fpm reload 就能重新加载配置文件。</p>
<p>sudo /etc/init.d/networking restart<br>sudo service network-manager restart</p>
<p>医院自助招呼系统，餐馆呼叫系统  微信 /app<br>超级电话本，收集周边常用民生电话，一键呼叫，可以收藏 一键导入，做完软件转让给运营的团队<br>分类收藏，更多</p>
<p>wget <a href="https://github.com/adobe-fonts/source-code-pro/archive/1.017r.zip" target="_blank" rel="external">https://github.com/adobe-fonts/source-code-pro/archive/1.017r.zip</a></p>
<p>unzip 1.017r.zip</p>
<p>mkdir -p ~/.fonts</p>
<p>cp source-code-pro-1.017r/otf/*.otf ~/.fonts/</p>
<p>fc-cache -f -v</p>
<p>有的下载地址下载下来后内容纷歧样。</p>
<p>安装，</p>
<p>[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype<br>sudo git clone <a href="https://github.com/adobe-fonts/source-code-pro.git" target="_blank" rel="external">https://github.com/adobe-fonts/source-code-pro.git</a> /usr/share/fonts/opentype/scp<br>sudo fc-cache -f -v<br>查看，</p>
<p> fc-list  | grep “Source Code Pro”</p>
<p>todolist<br>通知张建章域名续费 flower.fj.cn  xmshop.com.cn</p>
<p>1.闹钟，计时，番茄钟，声音，提示音，屏蔽手机上的某款app或全部app的弹窗<br>2.课程表<br>3.任务采集与计划，检查，回顾<br>4.图表装B<br>5.数据同步</p>
<p>路由器 admin/admin admin/yunhor888</p>
<p> 禁用chrome的flash 世界清静许多 chrome:plugins</p>

    

    
</div>


                

                <!-- Post Comments -->
                
                    
                
            </div>

            <!-- Post Prev & Next Nav -->
            <nav class="material-nav mdl-color-text--grey-50 mdl-cell mdl-cell--12-col">
    <!-- Prev Nav -->
    
        <a href="/blog/2017/09/13/gitrm/" id="post_nav-newer" class="prev-content">
            <button class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--white mdl-color-text--grey-900" role="presentation">
                <i class="material-icons">arrow_back</i>
            </button>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            新篇
        </a>
    

    <!-- Section Spacer -->
    <div class="section-spacer"></div>

    <!-- Next Nav -->
    
        <a href="/blog/2017/08/18/server-setup/" id="post_nav-older" class="next-content">
            旧篇
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <button class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon mdl-color--white mdl-color-text--grey-900" role="presentation">
                <i class="material-icons">arrow_forward</i>
            </button>
        </a>
    
</nav>

        </div>
    </div>



                    
                        <!-- Overlay For Active Sidebar -->
<div class="sidebar-overlay"></div>

<!-- Material sidebar -->
<aside id="sidebar" class="sidebar sidebar-colored sidebar-fixed-left" role="navigation">
    <div id="sidebar-main">
        <!-- Sidebar Header -->
        <div class="sidebar-header header-cover" style="background-image: url(/blog/img/sidebar_header.png);">
    <!-- Top bar -->
    <div class="top-bar"></div>

    <!-- Sidebar toggle button -->
    <button type="button" class="sidebar-toggle mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon" style="display: initial;" data-upgraded=",MaterialButton,MaterialRipple">
        <i class="material-icons">clear_all</i>
        <span class="mdl-button__ripple-container">
            <span class="mdl-ripple">
            </span>
        </span>
    </button>

    <!-- Sidebar Avatar -->
    <div class="sidebar-image">
        <img src="/blog/img/avatar.png" alt="David's avatar">
    </div>

    <!-- Sidebar Email -->
    <a data-toggle="dropdown" class="sidebar-brand" href="#settings-dropdown">
        youremail@email.com
        <b class="caret"></b>
    </a>
</div>


        <!-- Sidebar Navigation  -->
        <ul class="nav sidebar-nav">
    <!-- User dropdown  -->
    <li class="dropdown">
        <ul id="settings-dropdown" class="dropdown-menu">
            
                <li>
                    <a href="#" target="_blank" title="Email Me">
                        
                            <i class="material-icons sidebar-material-icons sidebar-indent-left1pc-element">email</i>
                        
                        Email Me
                    </a>
                </li>
            
        </ul>
    </li>

    <!-- Homepage -->
    
        <li id="sidebar-first-li">
            <a href="/blog/">
                
                    <i class="material-icons sidebar-material-icons">home</i>
                
                主页
            </a>
        </li>
        
    

    <!-- Archives  -->
    
        <li class="dropdown">
            <a href="#" class="ripple-effect dropdown-toggle" data-toggle="dropdown">
                
                    <i class="material-icons sidebar-material-icons">inbox</i>
                
                    归档
                <b class="caret"></b>
            </a>
            <ul class="dropdown-menu">
            <li>
                <a class="sidebar_archives-link" href="/blog/archives/2018/06/">六月 2018<span class="sidebar_archives-count">2</span></a></li><li><a class="sidebar_archives-link" href="/blog/archives/2018/05/">五月 2018<span class="sidebar_archives-count">3</span></a></li><li><a class="sidebar_archives-link" href="/blog/archives/2018/04/">四月 2018<span class="sidebar_archives-count">1</span></a></li><li><a class="sidebar_archives-link" href="/blog/archives/2018/03/">三月 2018<span class="sidebar_archives-count">4</span></a></li><li><a class="sidebar_archives-link" href="/blog/archives/2018/02/">二月 2018<span class="sidebar_archives-count">4</span></a></li><li><a class="sidebar_archives-link" href="/blog/archives/2017/09/">九月 2017<span class="sidebar_archives-count">2</span></a></li><li><a class="sidebar_archives-link" href="/blog/archives/2017/08/">八月 2017<span class="sidebar_archives-count">8</span></a>
            </ul>
        </li>
        
    

    <!-- Categories  -->
    

    <!-- Pages  -->
    

    <!-- Article Number  -->
    
</ul>


        <!-- Sidebar Footer -->
        <!--
I'm glad you use this theme, the development is no so easy, I hope you can keep the copyright, I will thank you so much.
If you still want to delete the copyrights, could you still retain the first one? Which namely "Theme Material"
It will not impact the appearance and can give developers a lot of support :)

很高兴您使用并喜欢该主题，开发不易 十分谢谢与希望您可以保留一下版权声明。
如果您仍然想删除的话 能否只保留第一项呢？即 "Theme Material"
它不会影响美观并可以给开发者很大的支持和动力。 :)
-->

<!-- Sidebar Divider -->

    <div class="sidebar-divider"></div>


<!-- Theme Material -->

    <a href="https://github.com/viosey/hexo-theme-material"  class="sidebar-footer-text-a" target="_blank">
        <div class="sidebar-text mdl-button mdl-js-button mdl-js-ripple-effect sidebar-footer-text-div" data-upgraded=",MaterialButton,MaterialRipple">
            主题 - Material
            <span class="sidebar-badge badge-circle">i</span>
        </div>
    </a>


<!-- Help & Support -->
<!--

-->

<!-- Feedback -->
<!--

-->

<!-- About Theme -->
<!--

-->

    </div>

    <!-- Sidebar Image -->
    

</aside>

                    

                    
                        <!-- Footer Top Button -->
                        <div id="back-to-top" class="toTop-wrap">
    <a href="#top" class="toTop">
        <i class="material-icons footer_top-i">expand_less</i>
    </a>
</div>

                    

                    <!--Footer-->
<footer class="mdl-mini-footer" id="bottom">
    
        <!-- Paradox Footer Left Section -->
        <div class="mdl-mini-footer--left-section sns-list">
    <!-- Twitter -->
    
        <a href="https://twitter.com/twitter" target="_blank">
            <button class="mdl-mini-footer--social-btn social-btn footer-sns-twitter">
                <span class="visuallyhidden">Twitter</span>
            </button><!--
     --></a>
    

    <!-- Facebook -->
    
        <a href="https://www.facebook.com/facebook" target="_blank">
            <button class="mdl-mini-footer--social-btn social-btn footer-sns-facebook">
                <span class="visuallyhidden">Facebook</span>
            </button><!--
     --></a>
    

    <!-- Google + -->
    
        <a href="https://www.google.com/" target="_blank">
            <button class="mdl-mini-footer--social-btn social-btn footer-sns-gplus">
                <span class="visuallyhidden">Google Plus</span>
            </button><!--
     --></a>
    

    <!-- Weibo -->
    

    <!-- Instagram -->
    

    <!-- Tumblr -->
    

    <!-- Github -->
    

    <!-- LinkedIn -->
    

    <!-- Zhihu -->
    

    <!-- Bilibili -->
    

    <!-- Telegram -->
    
</div>


        <!--Copyright-->
        <div id="copyright">
            Copyright&nbsp;©<script type="text/javascript">var fd = new Date();document.write("&nbsp;" + fd.getFullYear() + "&nbsp;");</script>David's blog
        </div>

        <!-- Paradox Footer Right Section -->

        <!--
        I am glad you use this theme, the development is no so easy, I hope you can keep the copyright.
        It will not impact the appearance and can give developers a lot of support :)

        很高兴您使用该主题，开发不易，希望您可以保留一下版权声明。
        它不会影响美观并可以给开发者很大的支持。 :)
        -->

        <div class="mdl-mini-footer--right-section">
            <div>
                <div class="footer-develop-div">Powered by <a href="https://hexo.io" target="_blank" class="footer-develop-a">Hexo</a></div>
                <div class="footer-develop-div">Theme - <a href="https://github.com/viosey/hexo-theme-material" target="_blank" class="footer-develop-a">Material</a></div>
            </div>
        </div>
    
</footer>


                    <!-- Import File -->


    <script>lsloader.load("js/lazyload.min.js","/blog/js/lazyload.min.js?1BcfzuNXqV+ntF6gq+5X3Q==")</script>
    <script>lsloader.load("js/js.min.js","/blog/js/js.min.js?oAl/+lvaqTFV31JXTmbrNA==")</script>



    <script>lsloader.load("js/nprogress.js","/blog/js/nprogress.js?pl3Qhb9lvqR1FlyLUna1Yw==")</script>


<script type="text/ls-javascript" id="NProgress-script">
    NProgress.configure({
        showSpinner: true
    });
    NProgress.start();
    $('#nprogress .bar').css({
        'background': '#29d'
    });
    $('#nprogress .peg').css({
        'box-shadow': '0 0 10px #29d, 0 0 15px #29d'
    });
    $('#nprogress .spinner-icon').css({
        'border-top-color': '#29d',
        'border-left-color': '#29d'
    });
    setTimeout(function() {
        NProgress.done();
        $('.fade').removeClass('out');
    }, 800);
</script>













<!-- UC Browser Compatible -->
<script>
	var agent = navigator.userAgent.toLowerCase();
	if(agent.indexOf('ucbrowser')>0) {
		document.write('<link rel="stylesheet" href="/blog/css/uc.css">');
	   alert('由于 UC 浏览器使用极旧的内核，而本网站使用了一些新的特性。\n为了您能更好的浏览，推荐使用 Chrome 或 Firefox 浏览器。');
	}
</script>

<!-- Window Load-->
<script type="text/ls-javascript" id="window-load">
    $(window).on('load', function() {
        // Post_Toc parent position fixed
        $('.post-toc-wrap').parent('.mdl-menu__container').css('position', 'fixed');
    });
</script>

<!-- MathJax Load-->

<script type="text/ls-javascript" id="lazy-load">
    // Offer LazyLoad
    queue.offer(function(){
        $('.lazy').lazyload({
            effect : 'show'
        });
    });

    // Start Queue
    $(document).ready(function(){
        setInterval(function(){
            queue.execNext();
        },200);
    });
</script>

<!-- Bing Background -->


<script>
    (function(){
        var scriptList = document.querySelectorAll('script[type="text/ls-javascript"]')

        for (var i = 0; i < scriptList.length; ++i) {
            var item = scriptList[i];
            lsloader.runInlineScript(item.id,item.id);
        }
    })()
console.log('\n %c © Material Theme | Version: 1.4.0 | https://github.com/viosey/hexo-theme-material %c \n', 'color:#455a64;background:#e0e0e0;padding:5px 0;border-top-left-radius:5px;border-bottom-left-radius:5px;', 'color:#455a64;background:#e0e0e0;padding:5px 0;border-top-right-radius:5px;border-bottom-right-radius:5px;');
</script>

                </main>
            </div>
        </body>
    
</html>
